Link to home
Start Free TrialLog in
Avatar of dspangenberg
dspangenberg

asked on

Scripting photoshop to run specific actions based on folder names

I have a project that requires me to add logos to my files.  I have 51 logos - one for each state and one for the US.  the specific logo for an image is based on which folder I have it in.  I have created an action that resizes to a specific format and adds the logo by opening it then a copy and paste.  Since the logo is part of the action - I need to run 51 variations of this action on a daily basis.  I am looking for a way to automate it further by having photoshop process all of the images in a main folder by the names on the subfolders - (ie running the Alaska action on all files in subfolder AK....).  is this possible and if so how?

Thought about doing it via JavaScript but since I have never programmed Java I would be starting from scratch and not sure if that is the best way to go.
Avatar of weed
weed
Flag of United States of America image

On a Mac? Applescript is 100x easier than trying to do it in javascript.
ASKER CERTIFIED SOLUTION
Avatar of mmiika
mmiika

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mmiika
mmiika

Oh yes, and pre prepared, the scripting guide and reference Adobe offers are quite cryptic...

To get started here's a little script, replace ActionaName with name of your action and ActionSet with the name of the set that action is in.:

Dim myPhotoShop
Set myPhotoShop = CreateObject("Photoshop.Application")
myPhotoShop.doAction ActionName, ActionSet

1) Copy the above to a text file and save for example as "PhotoShopScriptTest.vbs"
2) open photoshop and the file you want to run action in (this can be automated as well..., but now for simplicity...)
3) double click on the "PhotoShopScriptTest.vbs" (run it)