Help with PS Action, specifically Conditional if else

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

Posts: 1
Joined: Wed Aug 26, 2020 12:56 am

Help with PS Action, specifically Conditional if else

Post by Quatapus »

Hey everyone,

I had an action that was working really well, but I think a recent PS update has wrecked it. The action "Make Color Selections" (which just plays several actions run in sequence) does a color range search. If it finds that color and creates a selection, there is a "Document Contains Selection" conditional statement that allows the action to proceed, eventually moving on to the text action in the sequence. If that color isn't present and there is no selection, it moves on to the next specified action to search for the next color range.

Everything works great if all of the colors are present (Red, Green, Magenta, Yellow, Cyan, Blue), but if one of those colors is not present, the action will go to the next action, finish it, but then jump back up to the previous action and continue at the step just after the Conditional statement.

The action searches for Red, but does not find that color and creates no selection. The conditional statement tells it to play the action that searches for Green. It finds green, makes a selection, does some other stuff, and reaches the end of the action where it is supposed to run the action that searches for Magenta. Instead, it finishes the Green action and jumps back up to the Red action step just after the conditional.

I've attached some screenshots, the .ATN file, and the PSD file I've been practicing with.
Actions 1.JPG
Actions 1.JPG (39.79 KiB) Viewed 2004 times
Actions 2.JPG
Actions 2.JPG (46.56 KiB) Viewed 2004 times
Thanks for any help you can offer. I've tried turning this into a JS script, but was way in over my head.
(1.71 MiB) Downloaded 230 times