3 Replies Latest reply on Dec 25, 2011 9:36 AM by Frans van der Geest

    Script for Overriding, Outlining, and Clearing Masters

    AudioGO_Designer

      As part of the submission process for one of our printers, we have to outline all the text on a set of labels. I've been trying to write a script to do three steps:

       

      1. Override all Master page objects

      2. Apply [none] master to all pages

      3. Outline all text

       

      I've gotten pretty far, but I seem to have hit a stumbling block on the Apply [none] master step. Any suggestions?

       

       

      var myDocument = app.activeDocument;
      
      var TotalPages = (myDocument.pages.count());
      
      for(var CurrentPage=0; CurrentPage < TotalPages; CurrentPage++) {
           OverrideMasterItems();
      } 
      
      
      function OverrideMasterItems() {
           myDocument.pages[CurrentPage].appliedMaster.pageItems.everyItem().override(myDocument.pages[CurrentPage]);
      }
      
      //this next part is where I have the problem... I would think it would select all the pages in the document, then change the master page to "null" but it doesn't seem to have any effect at all. 
      
      try{
          app.activeDocument.pages.everyItem().getElements().changeMaster(null);
          }catch(e){};
      
      //then this final part is working fine.
      
      try{
          app.activeDocument.textFrames.everyItem().createOutlines();
          }catch(e){};