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

Custom rules for Conditional Actions

Community Beginner ,
Nov 03, 2022 Nov 03, 2022

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!

TOPICS
Actions and scripting , macOS

Views

71

Likes

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
Community Expert ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

quote

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:

 

siva.png

 

http://actionlogic.blogspot.com/2006/03/sivas-photoshop-conditional-action.html

 

Likes

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
Community Expert ,
Nov 03, 2022 Nov 03, 2022

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.

Likes

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
Community Expert ,
Nov 05, 2022 Nov 05, 2022

Copy link to clipboard

Copied

LATEST

Likes

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
Community Expert ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

@PixelFactory Agency 

 

If you post it as an Idea, I'll vote for it!

 

Jane

Likes

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