3 Replies Latest reply on Sep 11, 2009 2:30 AM by Tony Tuneson

    Discover multiple pointsizes in a text

    Tony Tuneson Level 1

      If I manually select a paragraph that contains characters with different pointsizes, the pointsize dropdown in ID is empty, indicating that multiple pointsizes are used. However if I read Paragraph.Pointsize with a script, I get a value (I don't know which one, probably the first applied Style or so). Is there a way to determine if a whole Text is in the same pointsize, without iterating through all characters?

      Thanks in advance for thinking for me!  (ID CS3, VB)

        • 1. Re: Discover multiple pointsizes in a text
          Tony Tuneson Level 1

          I did find the TextstyleRange and it is helpful, but it applies to any change, not just fontsize and it doesn't seems to notice stylechanges by Nested Styles either. So not exactly what I was hoping for...

          • 2. Re: Discover multiple pointsizes in a text
            [Jongware] Most Valuable Participant

            In JS, the value for the pointSize would simply be 'undefined', rather than some number.

            I'd just try it out in VB and see what it reports for a mixed text.

            • 3. Re: Discover multiple pointsizes in a text
              Tony Tuneson Level 1




              'selects a text with multiple pointsizes. Indicated by empty Pointsize dropdown in InDesign.


              VBResult = myInDesign.ActiveDocument.Stories.Item(1).Texts.Item(1).PointSize

              Returns 10 on a text that has multiple pointSizes


              Same line, but with a DoScript in VB:

              JSResult = myInDesign.DoScript("app.activeDocument.stories.item(1).texts.item(1).pointSize", idJavascript)

              Returns an error: "Object is invalid"


              JSResult = myInDesign.DoScript("app.activeDocument.stories.item(1).texts.firstItem.pointSize", idJavascript)
              Returns Empty

              But it also returns Empty for texts that are set in only one pointSize!


              What am I doing wrong please? And how is firstItem different from Item(1)?


              (EDIT: I see that the forum added a space: "pointSi ze". It is not in my code)