0 Replies Latest reply on May 14, 2012 2:58 AM by Gupthika

    skip master page

    Gupthika

      Hi,

       

      I am very new for indesign scripting. i am trying to remove empty text and graphic frame in the indesign document. But it also remove from master page. How to skip master page??

       

      Here is the code

       

      var myStories = app.activeDocument.stories.everyItem().getElements();

                for (i = myStories.length - 1; i >= 0; i--){

                          var myTextFrames = myStories[i].textContainers;

                          for (j = myTextFrames.length - 1; j >= 0; j--)    {

                                    if (myTextFrames[j].contents == ""){

                                              app.selection = myTextFrames[j];

                                              alert (app.activeWindow.activePage.name);

                                              myTextFrames[j].remove();

                                    }

                          }

                }

       

      Please help me.

       

      Thanks

      Gupthika