Skip to main content
Participant
March 1, 2016
Question

How do I run an Apple Script on all currently open documents?

  • March 1, 2016
  • 3 replies
  • 723 views

Hi there,

I've got an Apple Script that I would like to run on all in Photoshop open documents and not just the current document/tab. Is there any way of doing this (ideally without having to close any documents in the process)?

Thanks a lot!

Tomas

This topic has been closed for replies.

3 replies

Inspiring
March 3, 2016

Try this.

tell application id "com.adobe.Photoshop"

           set allDocs to every document

           repeat with i in allDocs

                      set current document to i

                      tell i

                                 #Do your code here

                      end tell

           end repeat

end tell

greenrookie

Participant
March 1, 2016

Hi Chuck Uebele,

I am familiar with the batch processor but I have never assigned a script to an action. I am not quite sure how to do that.

Do You know how?

Thanks.

Tomas

Chuck Uebele
Community Expert
Community Expert
March 1, 2016

You just create an action, then when it is recording, you play your script, then then the action, when the script is done.

Participant
March 2, 2016

Unfortunately, that didn't do the trick. Running the script while recording an action didn't do anything. The action is still empty.

Chuck Uebele
Community Expert
Community Expert
March 1, 2016

You can assign your script to an action then run the action with the built in script "Batch" under the scripts automate menu.