1 Reply Latest reply on Jan 20, 2015 5:49 AM by Kasyan Servetsky

    How to tell script colse all files and save, but no untitle docs

    Teetan VK Level 1

      Hi everyone 

       

      I want to colse the open files and save them but no those files which have never been saved.

       

      I try this script but after ran, all the files are no be saved.

       

              var docs = app.documents;
                   for (var i = docs.length-1; i >= 0; i--) {
                       if(app.activeDocument.saved == false){
                             docs[i].close(SaveOptions.NO);
                           }
                       else if(docs[i].close(SaveOptions.YES));
                    }

       

      can someone tell me what's wrong with the script?

       

      thanks

      Regard

       

      Teetan