4 Replies Latest reply on Oct 30, 2015 8:53 AM by Johnwhite

    How to define a pageItems and a masterPageItems?

    Johnwhite Level 1

      Hi experts

       

      I got this script.

       

      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

      var myDoc = app.activeDocument;

          var myMasters = myDoc.masterItems.everyItem();

          var myObjects = myDoc.pageItems.everyItem().getElements();

                myDoc.pageItems.everyItem().locked = false;

                  var myLayers = myDoc.layers.everyItem();

                         myLayers.locked = false;

                          app.findObjectPreferences = app.changeObjectPreferences = null;

                          app.findObjectPreferences.fillColor = "Registration"; 

                          app.changeObjectPreferences.fillColor = "Black"; 

                          app.changeObject();

                         

                          app.findObjectPreferences = app.changeObjectPreferences = null;

                          app.findObjectPreferences = NothingEnum.nothing;

                          app.changeObjectPreferences = NothingEnum.nothing; 

                          app.findObjectPreferences = app.changeObjectPreferences = null;

                          app.findObjectPreferences.strokeColor = "Registration"; 

                          app.changeObjectPreferences.strokeColor = "Black"; 

                          app.changeObject();

                         

                          app.findObjectPreferences = app.changeObjectPreferences = null;

                          app.findObjectPreferences = NothingEnum.nothing;

                          app.changeObjectPreferences = NothingEnum.nothing; 

                          app.findTextPreferences = app.changeTextPreferences = null;

                          app.findTextPreferences.fillColor = "Registration"; 

                          app.changeTextPreferences.fillColor = "Black"; 

                          app.changeText();

                         

                          app.findTextPreferences = app.changeTextPreferences = null;

                          app.findTextPreferences = NothingEnum.nothing;

                          app.changeTextPreferences = NothingEnum.nothing; 

                          app.findTextPreferences = app.changeTextPreferences = null;

                          app.findTextPreferences.strokeColor = "Registration"; 

                          app.changeTextPreferences.strokeColor = "Black"; 

                          app.changeText();

                         

                          app.findTextPreferences = app.changeTextPreferences = null;

      //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

       

      but want it either work on every page and every master page.

       

      How can define it?

       

      thanks

       

      Regard

      John