Re: Determining a Paragraph's Index
Re: Determining a Paragraph's Index
- Subject: Re: Determining a Paragraph's Index
- From: Stan Cleveland <email@hidden>
- Date: Fri, 11 Aug 2006 16:07:15 -0700
- Thread-topic: Determining a Paragraph's Index
On 8/11/06 3:27 PM, Shane Stanley wrote:
> Get the index of the first character of the paragraph, and then get the
> count of paragraphs of text from character 1 to character theIndex of the
> story.
That's brilliant, Shane. One must also consider that a selection may touch
multiple paragraphs. To that end, and using your idea, this will give the
the indices of the first and last paragraphs of the selection (which will be
the same, if the selection involves only one paragraph):
tell application "Adobe InDesign CS2"
tell selection
set firstPara to (count of paragraphs from character 1 ¬
to character (index of character 1)) of parent story
set lastPara to (count of paragraphs from character 1 ¬
to character (index of character -1)) of parent story
end tell
end tell
Stan C.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden