Copy link to clipboard
Copied
Alt+Ctrl+W closes all documents if a modification was made a warning shows up asking to save or no.
My action "Close All-No Save" takes care of this but the action was written for 8 documents then if only 4 documents are open and playing the action
the dialog Continue or Stop shows up and one must click Stop.
Can a script close all open documents without saving regardless how many are open. An action would call the script and the clicking on the Stop in the dialog
would be not required.
I know not a big deal to click on stop but if it can be avoided why not?
was.close(AnswerOptions.DONOTANSWER)…
Copy link to clipboard
Copied
Then calling this may do what you wish…
#target photoshop while(app.documents.length > 0) { app.activeDocument.close(SaveOptions.DONOTSAVECHANGES); }
Copy link to clipboard
Copied
I can see in the script that it will work.
I am not on my working machine but will try it tonoght.
Thanks.
Copy link to clipboard
Copied
Works Perfect!
First I loaded the script with # target Photoshop and got an error then without this line it worked.
Great thank you very much
Copy link to clipboard
Copied
Photoshop CS5 has amenu item File>Close all when the prompt come up there is a check box you can check to have the your no save answer apply to all. You can use that in an action. Also Trevor Morris has many free scripts on his web site one is Close ALL Without Saving http://morris-photographics.com/photoshop/scripts/close-without-save.html
Copy link to clipboard
Copied
was.close(AnswerOptions.DONOTANSWER)…
Copy link to clipboard
Copied
New to this new layout.
Do I need to click on the buttons Helful or Correct Answer befor I reply. Want to do things right.
Have not tried it but as I mentioned before the script looks like that your answer is correct.
Late tonight New York Time I will chck it out
Copy link to clipboard
Copied
Not only close you were dead on.
Thanks for the help
Copy link to clipboard
Copied
I am still working in CS. The reason for it is being a much leaner program it is faster for what I do which is Events (take 3 pictures run an action inserting them in saved selections and print.
Will go to Trevor's Site . I know him from the PS forum since many years back and am aware of his abilities and knowledge.
Thank you for the info.
Copy link to clipboard
Copied
I am using Puppet Mark's Script now but also downloaded Trevor Morris;s CS2 Script.
This script would be very handy for me if the Dialog Box could be made sticky after selecting an option.
Contacted Trevor with this request.
Thanks for your hints.
Copy link to clipboard
Copied
Im sure Paul will let you know how to make a dialog selection sticky… I've seen this before in his scripts…
Copy link to clipboard
Copied
If you're feeling a bit more lazy, you can create an action by recording as you close an image and don't save it. Then just use batch and run the action on all open files.
Copy link to clipboard
Copied
In the height of laziness (er I mean efficiency) I recently wrote this script that closes all documents EXCEPT the one that you've got selected, useful if you find yourself in a situation where you're looking at lots of images and wondering which one to choice, select it and instantly disregard all the rest. Not that this happens frequently but I was curious write such a thing.
//close everything else execept the current document
//pref pixels
app.preferences.rulerUnits = Units.PIXELS;
// make a copy of the array
var docs = new Array();
for (i=0; i < app.documents.length; i++) {
docs = app.documents;
}
// call the selected document that you want to keep open
var selectedDoc = app.activeDocument;
//alert (docs.length + " number of docs open")
//run a loop for all the open documents
for (i=0; i < docs.length; i++) {
// if this isn't the selected document then close it
if (docs != selectedDoc) {
//close that document without saving
docs.close(SaveOptions.DONOTSAVECHANGES);
}
}
Copy link to clipboard
Copied
Works perfect.
Photographing Events I want to show 4 pictures. Customer selects the one they like the others are closed. It's here where the script invoked by an action comes in very handy.
Thanks for posting it.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now