• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Batching with a script?

New Here ,
Jul 18, 2017 Jul 18, 2017

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!

TOPICS
Actions and scripting

Views

338

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Enthusiast ,
Jul 18, 2017 Jul 18, 2017

Copy link to clipboard

Copied

LATEST

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()

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines