6 Replies Latest reply on May 30, 2017 10:26 AM by chadb78135425

    Script for Applying master Spread

    Math Kay Level 1

      Hi,

      This Script is for Applying CO-Opener master page  wherever CN is applied, When we run the script, it alerts Sucess.But master spread is not applied . Please resolve.

       

       

      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].parent.appliedMaster = mydoc.masterSpreads.item("CO-Opener");
              }
          }
      alert("Master Page applied Sucessfully")