Skip to main content
Inspiring
March 6, 2018
Answered

Custom Condition for Photoshop Actions

  • March 6, 2018
  • 4 replies
  • 3782 views

Trying to create a custom "condition" for a complex Photoshop Action.

I have a custom, Unlockbackround.jsx that is in the script menu.

That unlocks the backround layer and then proceeds to group all layers. is there a way to point a condition to a script.?

Right now the condition is

If  back round is locked

play locked backround,

if layer is unlocked then play unlocked backround

the problem is if the "back round layer isn't actually clicked on , it dosnt unlock.

thats why i wrote the .jsx

Problem is i don't want to deploy the scripts, only the actions to our company. any suggestions welcom

This topic has been closed for replies.
Correct answer pixxxelschubser

Thanks pixxxel schubser – that is sort of what I was referring to in post #3:

Or perhaps you could chain together two different conditional actions (one action playing another action)

Although it is “fun” using online translators to work out exactly what is going in your screenshot, would opening your action on an English installation still show the action in German?


Stephen_A_Marsh  schrieb

… Although it is “fun” using online translators to work out exactly what is going in your screenshot …

That's really a bad trap sometimes.

Stephen_A_Marsh  schrieb

… would opening your action on an English installation still show the action in German?

Not in the past.

But perhaps with the newest versions? Please try it:

Dropbox - Background conditional.atn

4 replies

Stephen Marsh
Community Expert
Community Expert
March 7, 2018

Yes, I did mention that at least twice in two different posts.

There may be clues in my earlier post, I need to test a bit further. Actions have limitations and sometimes one can only take things so far without scripts.

I’d be interested to hear from other users to see if they have any workarounds.

Inspiring
March 7, 2018

I wrote a script but then that would also have to be deployed to all the employees as well

pixxxelschubser
Community Expert
Community Expert
March 10, 2018

Hi pixxxel schubser yes, it is your action in CC18 and nothing further was done, simply loaded into an English version. Thank you for sharing the action and helping to find an answer.


Your own help should not be underestimated!

It was a nice playing in the sandbox. Take and give relationship.

Thank you too.

Stephen Marsh
Community Expert
Community Expert
March 7, 2018

If you don’t wish to use scripts, then the only other way I can think of to do this in an automated/idiot proof fashion would be to use Conditional Actions. Although Conditional Actions are very limited, they may just do the job for your specific use case.

Select the back layer ( opt/alt + , ) then check to see if it is a true background image “layer” (rather than a standard layer that just happens to be named “Background” and also just happens to be the back layer and also just happens to also be locked).

or:

This could lead incorrect results if the back layer is a non background layer and it is locked…

Or perhaps you could chain together two different conditional actions (one action playing another action) to check for both locked and background, which is probably overkill.

Anyway, explore these ideas and you should have a viable solution that does not have a dependency on a script. Let me know if you need me to comment further on these points.

EDIT: I just tested with a flattened image and the select back layer step results in an error, so this may not help if there is a chance of flat images being processed.

Inspiring
March 7, 2018

how do i get it to record select back layer?

Stephen Marsh
Community Expert
Community Expert
March 7, 2018

Don’t use the select back layer command if your source images are flattened with only a Background image… So if you are sure that there will be at least a single layer or one or more layers + Background image, then simply record and press:

opt ,

or

alt ,

(That is Option Comma on the Mac OS or Alt Comma on Win OS). There are many keyboard shortcuts that record commands in actions that may no be obvious simply looking at the menus, GUI etc.

pixxxelschubser
Community Expert
Community Expert
March 6, 2018

Are there only files with more than one layer?

(Only) in this case it is possible to create an action which always creates an background layer - or always makes layer from background layer, no matter if a background layer exists or not. No script will be needed.

But if there are also files with only one layer exists - than you will need a script.

Legend
March 6, 2018

This script always "unlocks" the Background even if it does not exist or is not selected. )

try { app.activeDocument.backgroundLayer.isBackgroundLayer = false } catch(e) {  }