Skip to main content
Participant
December 31, 2024
Answered

Batch process multiple actions

  • December 31, 2024
  • 5 replies
  • 1582 views

I have about 20 different actions that I would like to batch process on sets of images simultaneously. The source and the destination folder is always the same to simplify things (I just move the finished images from these temporary folders to their final destination folder after processing). I have the Save As function recorded in the actions already, and each action is set to save as in its own specific destination folder. (again these are temporary folders that I use for Photoshop processing. Once the images are done, I move these images from here to a final destination folder).
The actions work when triggered manually.

I don’t see an obviously way to batch process multiple actions with Photoshop. I can only highlight individual actions and hit the play button. I’m not good at scripts or Automator.
Any help or script is appreciated. ChatGPT gives me the runaround of course. Can’t wait for product specific AI help to hit the markets.
Thanks everyone and happy new year!

Correct answer Conrad_C

Two things that might help:

 

An action can call other actions. So if you want to run multiple actions in one click, include them in a parent action. For example, you create an action, and while recording it, you start other actions. When you stop recording you’ll see those actions listed within the parent action.

 

quote

I don’t see an obviously way to batch process multiple actions with Photoshop. I can only highlight individual actions and hit the play button.

By @Attila7479

 

Another part of the solution might be the File > Automate > Batch command. It doesn’t run multiple actions, but it can for example let you pick a folder and run an action on all the files in the folder.

 

So then you can combine the first suggestion (create an action that calls multiple actions in series), with the second suggestion (apply that action to a whole folder of images using the Batch command).

5 replies

c.pfaffenbichler
Community Expert
Community Expert
January 1, 2025

As indicated earlier I suspect the saving issue may need attention but this might provide a starting point; a dialog with the Actions from the first Set, that would run the selected Actions after OK-ing. 

// dialog with actions from first set of actions;
// 2024, use it at your own risk;
if (app.documents.length > 0) {
var theActionSets = getActionSets();
var theseActions = getActions(theActionSets[0]);
var myDocument = app.activeDocument;
//////////////////////////////////////////
var dlg = new Window('dialog', "action from first set", undefined);
//////////////////////////////
dlg.theList = dlg.add('listbox', [15,15,325,537], 'field', {multiselect: true});
// populate the list with the open files’ names;
for (var o = 0; o < theseActions.length; o++) {
dlg.theList.add ("item", theseActions[o]);
};
//dlg.theList.items[0].selected = true;
dlg.theList.onDoubleClick = function () {
var anArray = new Array;
};
//////////////////////////////
// build- and cancel-button;
dlg.cancelOk = dlg.add('panel', [12,495,308,550], "");
dlg.cancelOk.buildBtn = dlg.cancelOk.add('button', [10,10,141,40], 'OK', {name:'ok'});
dlg.cancelOk.cancelBtn = dlg.cancelOk.add('button', [149,10,280,40], 'Cancel', {name:'cancel'});
dlg.center();
var myReturn = dlg.show ();
//////////////////////////////
if (myReturn == true) {
// run clicked actions;
for (var o = 0; o < dlg.theList.items.length; o++) {
if (dlg.theList.items[o].selected == true) {
app.doAction(String(dlg.theList.items[o]), String(theActionSets[0]))
}
};
};
};
////////////////////////////////////
////////////////////////////////////
////////////////////////////////////
// using code by xbytor and paul riggott;
function getActionSets() { 
cTID = function(s) { return app.charIDToTypeID(s); }; 
sTID = function(s) { return app.stringIDToTypeID(s); }; 
var i = 1; 
var sets = [];  
while (true) { 
var ref = new ActionReference(); 
ref.putIndex(cTID("ASet"), i); 
var desc; 
var lvl = $.level; 
$.level = 0; 
try { 
desc = executeActionGet(ref); 
} catch (e) { 
break;   
} finally { 
$.level = lvl; 
} 
if (desc.hasKey(cTID("Nm  "))) { 
var set = {}; 
set.index = i; 
set.name = desc.getString(cTID("Nm  ")); 
set.toString = function() { return this.name; }; 
set.count = desc.getInteger(cTID("NmbC")); 
set.actions = []; 
for (var j = 1; j <= set.count; j++) { 
var ref = new ActionReference(); 
ref.putIndex(cTID('Actn'), j); 
ref.putIndex(cTID('ASet'), set.index); 
var adesc = executeActionGet(ref); 
var actName = adesc.getString(cTID('Nm  ')); 
set.actions.push(actName); 
} 
sets.push(set); 
} 
i++; 
} 
return sets; 
}; 
function getActions(aset) {
cTID = function(s) { return app.charIDToTypeID(s); }; 
sTID = function(s) { return app.stringIDToTypeID(s); };
var i = 1;
var names = [];
if (!aset) {
throw "Action set must be specified";
}  
while (true) {
var ref = new ActionReference();
ref.putIndex(cTID("ASet"), i);
var desc;
try {
desc = executeActionGet(ref);
} catch (e) {
break;
}
if (desc.hasKey(cTID("Nm  "))) {
var name = desc.getString(cTID("Nm  "));
if (name == aset) {
var count = desc.getInteger(cTID("NmbC"));
var names = [];
for (var j = 1; j <= count; j++) {
var ref = new ActionReference();
ref.putIndex(cTID('Actn'), j);
ref.putIndex(cTID('ASet'), i);
var adesc = executeActionGet(ref);
var actName = adesc.getString(cTID('Nm  '));
names.push(actName);
}
break;
}
}
i++;
}
return names;
};

 

c.pfaffenbichler
Community Expert
Community Expert
January 1, 2025

And just to make sure: Are you sure the recorded »Save As«-step will not overwrite an existing file repeatedly? (Or is that the intention?) 

Bojan Živković11378569
Community Expert
Community Expert
January 1, 2025

"I can only highlight individual actions and hit the play button."

 

You can record an action step to trigger another action. Just avoid moving actions from one set to another, as the path is hard-coded, and do not rename the action after recording the step to play it. Is that what you meant, or is there another issue you're facing?

Conrad_C
Community Expert
Conrad_CCommunity ExpertCorrect answer
Community Expert
December 31, 2024

Two things that might help:

 

An action can call other actions. So if you want to run multiple actions in one click, include them in a parent action. For example, you create an action, and while recording it, you start other actions. When you stop recording you’ll see those actions listed within the parent action.

 

quote

I don’t see an obviously way to batch process multiple actions with Photoshop. I can only highlight individual actions and hit the play button.

By @Attila7479

 

Another part of the solution might be the File > Automate > Batch command. It doesn’t run multiple actions, but it can for example let you pick a folder and run an action on all the files in the folder.

 

So then you can combine the first suggestion (create an action that calls multiple actions in series), with the second suggestion (apply that action to a whole folder of images using the Batch command).

Participant
January 1, 2025

OK, thank you for responding, that could work. However, how do I add the step of opening the images from the source folder? Obviously these images will always be different, different amount of images, different kind of images. I cannot record the batch process within the action. In other words, I cannot record the steps for opening the images within the source folder and outputting them into the destination folder within the action. Running the actions with batch processing works, but that puts me back to the necessity of manually to triggering all my actions separately with batch processing. Saving the images into the destination folder can be recorded within the action and it works fine when I trigger the action with batch processing. Again, my sources and destination folders will always be the same therefore, saving the images should always work fine.

I just don't know how to tell Photoshop to open the images within the source folder. It should be the first step in the recording for the action, however, folders cannot be chosen (therefore, I cannot choose my source folder for this step), only images within the folder. And since the images within my source folder will always differ, that does not work. Thank you so much for any help you can offer.

Stephen Marsh
Community Expert
Community Expert
January 1, 2025

@Attila7479 

 

As I originally wrote, automate/batch.

 

As Conrad also replied, file > automate > batch.


Batch would run an action that plays all the other actions.

Stephen Marsh
Community Expert
Community Expert
December 31, 2024

@Attila7479 

 

It's not clear what you want to do:

 

1) Serially play 20 separate actions, one after the other on each automate/batch image? If so, an action can be recorded playing multiple actions.

 

2) Have one or more actions conditionally play on each automate/batch image, depending on image specific criteria? If so, conditional actions or a script would be required.

 

3) Something else?