1 Reply Latest reply on Dec 22, 2015 7:53 PM by Chinnadk

    Create Paragraph styles based on other paragraph styles

    johnpredmore

      I'm just learning scripting and created the following to automate the creation of paragraph styles.

       

      This works fine; but I would like to link the styles as with the "Based On" menu so that if I make a change (font, color, etc) it would cascade down the styles.

       

      Any thoughts?

       

       

      Main();

      function Main() {

        if (app.documents.length > 0) {

        var myDoc = app.activeDocument;

              // Paragraph Styles

              var myH1 = myDoc.paragraphStyles.add({name:"H1", appliedFont:"Avenir Next", pointSize:21, leading:24});

              var myH2 = myDoc.paragraphStyles.add({name:"H2", appliedFont:"Avenir Next", pointSize:17, leading:21});

              var myH3 = myDoc.paragraphStyles.add({name:"H3", appliedFont:"Avenir Next", pointSize:14, leading:17});

              var myH4 = myDoc.paragraphStyles.add({name:"H4", appliedFont:"Avenir Next", pointSize:11, leading:14});

                }

      }