During the course of my work I am constantly in a position where I would like to close all the documents that I have open except the templates I am working with.
If I were to have the word “keep” in each of my template document names, how would I go about writing some javascript code to run in photoshop that will close all open documents that DO NOT have the word “keep” in their names?
3
Answers
As it turns out there was an easy way to avoid the part that I was not sure how to proceed with...
Performing the desired operation on a single document is easy:
What was confusing me was how to write a script that would perform this operation on EVERY open document. I quickly realized that this could easily be taken care of by recording an action playing this simple script and batching the action on all open files in photoshop.
It sounds like you wish to
But then again, I’m probably forgetting some edge cases since I haven’t tried this specifically.
Start with something small, get it working and come back with specific questions when they appear if you can’t find an answer to the specific questions.
What you need to do is grab the Documents array and iterate through them. This code should do the trick. The search phrase is case sensitive.