2 Replies Latest reply on Mar 8, 2010 11:31 AM by Tom Tomasko

    How to find overridden object styles.

    Tom Tomasko Level 1

      Hello,

       

      I am working with lengthly documents that have a number of object and paragraph styles. Some styles are overridden. Some of these are correctly overridden, for instance when the tracking is changed. But some are incorrectly overidden.

       

      I would like to write a script that finds each instance of an applied style and tells me whether it is overridden. In rummaging around the ESTK I cannot find any properties that indicate an overridden style. Can someone point them out, if they do indeed exist?

       

      Thanks,

      Tom

        • 1. Re: How to find overridden object styles.
          John Hawkinson Level 5

          Pargraph.styleOverridden (Read Only)

          Data Type: boolean

          If true, the applied style has been overridden with addtional attributes

          • 2. Re: How to find overridden object styles.
            Tom Tomasko Level 1

            Thanks John. I was looking in all the wrong places. I now have a script that searches for each paragraph and, if any of the paragraphs are overridden, I mark them with an XML tag. This makes it much easier for the user who has to check each paragraph to make sure there are no overrides or at least they are legitimate overrides. For instance, in a 94 page document I only had to look at 26 suspect paragraphs.

             

            But every good answer brings up more questions.

             

            I do not see anyway to check for Object Style overrides, that is, I cannot find a StyleOverridden property for an object style. Here is the pseudo code that I think will solve this, but part of it I need a little help with.

             

            In nested for statements:

             

            If textFrame[i].appliedObjectStyle.name == myDoc.objectStyle[j].name;

            Then compare the properties of both;

            If there is a difference, put that text frame in an array;

             

            Any ideas on how to compare the properties? There are scores of them and some of them are in arrays that would have to be searched.

             

            Tom