Re: getting reference as string for rebuilding a reference
Re: getting reference as string for rebuilding a reference
- Subject: Re: getting reference as string for rebuilding a reference
- From: Michelle Steiner <email@hidden>
- Date: Mon, 24 Jan 2011 23:10:47 -0700
On Jan 24, 2011, at 9:01 PM, Adam Morris wrote: Hi there applescripters,
I'm scripting Pages, and the "get selection" gives me a reference like this:
text from character 44 to character 49 of body text of document id 1706710 of application "Pages"
What I want to do is calculate a new selection (say, from character start_char to character end_char) based on that first, given, selection.
tell application "Pages" set sel to the selection {character offset, length} of sel end tell
That will give you the location from the beginning of the document of the first character of the selection, and the length of the selection. The arithmetic should be obvious.
-- Michelle -- "No" is not a bad word.
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden