0 Replies Latest reply on Nov 30, 2012 6:10 AM by nicsor

    Batch clearing frame overrides

    nicsor

      Hi,

       

      I'm having a bunch of template documents where I've not been clearing the overrides of text and graphics frame before saving. Can someone please help me with a code for batch clearing the overrides? The code is based on Thomas Nielsens "batch import of paragraph styles".

       

      var MyFolderWithFiles = Folder.selectDialog ("Choose a folder");
      var myFiles = MyFolderWithFiles.getFiles("*.indd");
      
      
      for(i = 0; i < myFiles.length; i++) {
                theFile = myFiles[i];
                app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
                var targetDoc = app.open(theFile, true);
                app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
           targetDoc.PageItemDefault.appliedTextObjectStyle = applyObjectStyle("[Default textframe]", clearingOverrides(true));
           targetDoc.PageItemDefault.appliedGraphicObjectStyle = applyObjectStyle("[Default graphicsframe]", clearingOverrides(true));
                targetDoc.close(SaveOptions.YES);
      }
      

       

      Thanks,

      Niclas