Copy link to clipboard
Copied
Hi everyone!
Is it possible to add customised rules for conditional actions?
For example, I would need to have the condition 'if document contains paths' to process images with paths or without paths in two different ways.
Is there possibly a guide for scripting custom conditions and adding them to the menu of conditional actions?
Thank you very much for your support!
Copy link to clipboard
Copied
Is it possible to add customised rules for conditional actions?
By @PixelFactory Agency
No, however, I believe that they are long overdue for a refresh!
Other conditionals need to be scripted. Here is a simple conditional path script that has no GUI, it uses hard-coded references to actions, however, it could be a script that is run instead.
#target photoshop
if (activeDocument.pathItems.length > 0) {
//alert("A path exists!");
app.doAction("Action 1", "Action Set 1");
} else {
//alert("A path doesn't exist!");
app.doAction("Action 1", "Action Set 2");
}
Or:
#target photoshop
try {
activeDocument.pathItems[0].select();
//alert("A path exists!");
app.doAction("Action 1", "Action Set 1");
} catch (e) {
//alert("A path doesn't exist!");
app.doAction("Action 1", "Action Set 2");
}
The above is just attempting to select the top, first path, zero indexed, not dependent on naming... But it can be more specific PathKind and check for an unsaved work path or a saved path set as a clipping path.
A GUI could be added, to allow one to select the action rather than have it hard-coded.
There is also this:
http://actionlogic.blogspot.com/2006/03/sivas-photoshop-conditional-action.html
Copy link to clipboard
Copied
I think that @Stephen_A_Marsh could initiate an Ideas thread with suggestions of new conditionals that others could supplement. But being able to add custom conditionals via scripting is a nice idea in itself.
Copy link to clipboard
Copied
Copy link to clipboard
Copied