1

I have a problem with the automation of processes in Photoshop (CC) and I hope that you can help me, or lead me where I could look for answers.

I created my own action in PS that processes the photo and adds various graphical elements (I called it working: Action A).

I have a lot of pictures so I run the action using "Batch sequence ...".

Batch sequence opens the photo and launches "Action A". After time the alert box appears.

I can then choose "stop" and "continue".

At this point i need the second action (I called it working: Action B) to be activated when the dialogue box appears

I was looking for solutions in various forums and found only this: https://forums.adobe.com/thread/1218184

Please help.

I greet Arthur

Artiem
  • 25
  • 7

1 Answers1

1

You can convert your Action to a script and then use any conditional statement to decide what to do next.

For example, let's say your Action A has 10 steps and you want the 10th step to be a condition for deciding what to do next. You can convert your action to a script using the xbytor's ActionToScript script (working link), in the resulting JSX file you'll find all your action steps converted to javascript code. You can use this file instead of your Action A or you can use only the part you need (10th step in my example), leaving all 9 previous steps as action steps and inserting the script as a last step.

Then in the script you can use try..catch or if statement to decide which action to play, for example this code is a command "Feather Selection" converted from Action. It tries to play, and if everything is fine, Action B from My Actions set will be played next. If it encounters an error (for example, there's no selection to feather), Action C will be played

function cTID(s){return app.charIDToTypeID(s);};
function sTID(s){return app.stringIDToTypeID(s);};

try
{
    var desc2285 = new ActionDescriptor();
    desc2285.putUnitDouble(cTID('Rds '), cTID('#Pxl'), 5.000000);
    desc2285.putBoolean(sTID('selectionModifyEffectAtCanvasBounds'), false);
    executeAction(cTID('Fthr'), desc2285, DialogModes.NO);

    app.doAction("Action B", "My Actions");
}
catch (e)
{
    app.doAction("Action C", "My Actions");
}
Sergey Kritskiy
  • 2,199
  • 2
  • 15
  • 20