1 Reply Latest reply on Aug 29, 2014 10:35 AM by BEGINNER_X

    Master Page applied for specified Paragraph Styles

    Murali_Vetha Level 1



      How to apply specified master pages for specified Paragraph Styles: For Example:


      When I have Chapter Head styles, then automatically Chapter Head Master pages are need to applied.


      See my codings:




      var mydoc = app.activeDocument;

      var mypara = mydoc.stories.item(0).paragraphs.everyItem().getElements();

      for (i=0; i<mypara.length; i++)


        if (mypara[i].appliedParagraphStyle.name == "CN")


         mypara[i].parentTextFrames[0].parentStory.appliedMaster = mydoc.masterSpreads.item("CO-Chap Opener");