2 Replies Latest reply on Jul 27, 2014 8:19 AM by rob day

    Unwanted styles remove

    Murali_Vetha Level 1



      How to remove unwanted styles from indesign through javascript. please explain

        • 1. Re: Unwanted styles remove
          TᴀW Adobe Community Professional & MVP

          To remove a paragraph style, do this:




          where myParagraphStyle is a reference to a paragraph style in the document.


          For instance, you could get a reference to a paragraph style like this:


          myParagraphStyle =

          app.activeDocument.paragraphStyles.itemByName("Chapter Title")


          This implies that you have a document open and that it contains a

          paragraph style called "Chapter Title" outside of any paragraph style



          However, the AI in JavaScript is kind of limited, so it cannot tell

          whether a given paragraph style is unwanted by the user.


          Possibly, if there were a freak electricity spike in the mains just as

          you were running the script, and if God were smiling upon you, then

          perhaps the paragraph style that you consider unwanted would be deleted,

          but I would not rely on that for production purposes.

          • 2. Re: Unwanted styles remove
            rob day Adobe Community Professional & MVP

            Do you mean unwanted or unused? As in Select All Unused from the paragraph styles menu?