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: Adam Morris <email@hidden>
- Date: Wed, 26 Jan 2011 06:40:12 +0700
>tell application "Pages"
> set sel to the selection
> {character offset, length} of sel
>end tell
Thanks Michelle, and to Chris off-list; that same hint got me going,
the solution is the following:
-- "Move" the current selection over by one character
tell application "Pages"
set sel to selection
set {chr_offset, l} to {character offset, length} of sel
set new_offset to chr_offset + 1
-- Pages doesn't let you set character offset or length directly, so rebuild it
set new_sel to a reference to text from character new_offset to
character (new_offset + l) of body text of front document
select new_sel
end tell
_______________________________________________
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