3 Replies Latest reply on Jul 6, 2010 8:18 AM by [Jongware]

    How to get Paragraph "Style Settings"

    sudar1983_14 Level 2

      I wanna read all the properties from Paragraph style, see the below image.

       

       

      Arivu...Get-Style_Details.jpg

        • 1. Re: How to get Paragraph "Style Settings"
          [Jongware] Most Valuable Participant

          All of them, really? The basic object "Paragraph Style" has 180 different properties, and many of those are compound objects of their own (nested line styles, underline type, tabs, the font). This (extremely quickly written) script shows all of the base properties:

           

           

          proplist = app.selection[0].appliedParagraphStyle.reflect.properties;
          toShow = [];
          for (p in proplist)
           try {
            toShow.push (proplist[p]+": "+app.selection[0].paragraphs[0][proplist[p]]);
           } catch(_) {}
          alert (toShow.join(" / "));
          

           

          -- the 'catch' construction is necessary because attempting to add some properties would lead to an infinite loop (all of the properties of the Next style, for example, where that is the same as this style).

          • 2. Re: How to get Paragraph "Style Settings"
            sudar1983_14 Level 2

            Thanks for your reply, but my requirement is: whatever details available in the "Style Setting" tab.

             

            2010-07-06_203514.JPG

             

            Arivu...

            • 3. Re: How to get Paragraph "Style Settings"
              [Jongware] Most Valuable Participant

              That's not made available to scripting, it's just an interface thing.

               

              But the solution is easy: all you have to do is look at the "Based On" style, and compare each property to that.