Skip to main content
Inspiring
March 6, 2018
Answered

Custom Condition for Photoshop Actions

  • March 6, 2018
  • 4 replies
  • 3788 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

Stephen Marsh
Community Expert
Community Expert
March 7, 2018

I  understand why you are looking for an action only solution… it is yet to be determined if this is possible.

Actions can record a “relative path” to an installed script in the preset folder that is available  in the script menu – or an action can record the adhoc use of a script that has not been installed using an “absolute path” (this second point would not be useful in a multi user setting unless you could guarantee that all users could access the same shared resource using the same absolute file path i.e. on a server, what if there are both Mac and Win users?).

So, I see three options:

1. Try to make this work only using an action (may or may not be possible, as I said I have an idea that I’ll test later)

2. Distribute both action and script

3. Create a script for the entire process so that only one file needs to be distributed, installed and maintained

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) {  }