5 Replies Latest reply on Nov 23, 2015 1:13 AM by Johnwhite

    How to save and overwrite the file

    Johnwhite Level 1

      Hi experts

       

      I got this script:

       

      //======================================================================================== =========

      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.close(SaveOptions.YES.WITH_OVERWRITE);
      }

      //======================================================================================== =========

       

      aim to save and overwrite the files.

       

      but error, could someone help me to fix it.

       

      Thanks

       

      Regard

      John