2 Replies Latest reply on Jan 20, 2015 6:17 PM by Teetan VK

    How can tell the script I want to save unsaved files but not replace the old one?

    Teetan VK Level 1

      Hi everyone

       

      I got this script

       

      var docs = app.documents; 

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

          if (docs[i].saved == false) { 

              docs[i].save(new File(“~/Desktop/Document.indd”)); 

              docs[i].close(); 

          } 

          else { 

              docs[i].close(SaveOptions.YES); 

          } 

      }

       

      close and save files

       

      but if I have two or more files, I want to save files like Doc1, Doc2...

      the new file will never replace the old one

       

      Can some one tell me how can I do that?

       

      Thanks

      Regard

       

      Teetan