// While the number of documents is greater than 1 while (app.documents.length >=1){ // Close the current document without saving app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); }