3 Replies Latest reply on Nov 10, 2008 5:17 AM by (Maximilian_Gaerber)

    Paragraph or Text or Word?

    (Maximilian_Gaerber)
      Hi all,

      I am a little bit confused about the relations between Paragraph, Text and Word (concerning CS3).

      1. What's the difference between Text and Paragraph or Text and Word?

      2. From the ESTK it looks like any of them can contain every other... are there any assumptions about hierarchy that can be made?

      Regards,

      Max
        • 1. Re: Paragraph or Text or Word?
          Peter Kahrel Adobe Community Professional & MVP
          A Paragraph is a stretch of text between two returns (paragraph marks).

          A Word is something that InDesign is sometimes confused about: in the interface, double-clicking selects a word and selects all consecutive letters. In scripting, when you place the cursor somewhere in a word and run app.selection[0].words[0].contents you'll see that Word means "anything between two spaces, two em-dashes, or two en-dashes (or a combination of these)".

          A Text is anything that's not a Paragraph, Word, or Character. Select half a paragraph and you'll get a Text; select several paragraphs and you'll get Paragraphs or Text, depending on how you select them: if the first and/or the last paragraph in the selection are not completely selected, you end up with a Text; if they are completely selected, you get Paragraphs.

          As to hierarchy, a Story contains Paragraphs, which contain Words, which contain Characters. A Story also contains Text (or TextStyleRange, if there's any formatting present). A Text can contain Paragraphs (and therefore Words), and a single Paragraph can contain Text. So the hierarchy is clear and simple, apart from Text, which has a variable relationship with other text objects.

          Some playing around with selections and running the single line app.selection[0] in the ESTK console is instructive.

          Peter
          • 2. Re: Paragraph or Text or Word?
            Level 1
            and there is also Line - as "line of text" - and TextColumn

            robin

            --
            www.adobescripts.com
            • 3. Re: Paragraph or Text or Word?
              (Maximilian_Gaerber) Level 1
              Thanks for all the useful information!

              Are you going to use the Niemann-Ross WIKI to document such things or is there another place where you (I) could paste this?

              @Peter: I bought your TecFeed about InDesign Scripting and it helps a lot but I am still searching for something that covers all this "general" information as well - is there anything?