Copy link to clipboard
Copied
*Working on a Windows 7 PC & Photoshop CC 2017*
I've been working on automating the Photoshop workflow at my office where we do photography. In our old system, we would use Adobe Bridge to batch our photos through a series of actions and then manually have to photo transferring from folder to folder. Now, I've been developing a script (in JavaScript) to do all of this for us. Here's the workflow process for the script:
1. Open the CR2 (raw) photos to be saved a JPGs
2. Open the newly made JPGs
3. Run the JPGs through a few actions to resize them and save them in other folders
My issue comes with step #2. Currently, my script will only open 1 JPG, but I need to tell it to open all of them in the specified folder. Here's my current code for this step-
var scode = prompt("Enter scode");
desc1.putPath(cTID('null'), new File("/j/Jobs2017/_Photoshop Resources/Scripts/Open file/J/"+ scode +"/JPG/test.jpg"));
With this code, it will only open 'test.jpg' and run that through the action. Is there a way to have it open ALL of the JPGs in the folder?
Thanks for the help!
Copy link to clipboard
Copied
Hi,
You can use a Folder-object to get a list of files and open them in loop, something like below. Look for "Javascript Tools Guide"
var folder = new Folder('path/to/dir')
var files = folder.getFiles()