• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determining a Paragraph's Index
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread 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

References: 
 >Re: Determining a Paragraph's Index (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: [ANN] Usable Keychain Scripting
  • Next by Date: script won't compile if object doesn't exist
  • Previous by thread: Re: Determining a Paragraph's Index
  • Next by thread: setting the list view on a folder
  • Index(es):
    • Date
    • Thread