Copy link to clipboard
Copied
I spent some time today creating actions to automate masks for shadows and highlights, but when I looked at the steps in the actions they involved accessng the layers by the layer names, and Photoshop seems to automatically name the layers based on the file name. So the actions that I created with one file and its layer names failed on the next file because the script could not find the specified layer name to click on. That made me wonder if there was some setting that specified how the system should specify label names, but when I looked at the Settings options I could not find anything like that.
I can get around this problem by renaming every original layer "Layer 0" or something like that and re-recording the scripts, but I was wondering if there was some option that I missed when looking over the settings. Alternately, what do others do when creating actions that refer to label names? Or how do they avoid using label names?
You either set explicit, unique names with no duplicates so that they can be targeted for selection by absolute selection – or you select layers via relative selections (front or back layer, or relative to the currently selected layer – next or previous layer).
Relative Selection Layer Keycuts:
Select/target front (top) layer = Option + .
Select/target next layer up = Option + ]
Select/target next layer down = Option + [
Select/target back (bottom) layer = Option + ,
Relative Move Layer Key
...Copy link to clipboard
Copied
You either set explicit, unique names with no duplicates so that they can be targeted for selection by absolute selection – or you select layers via relative selections (front or back layer, or relative to the currently selected layer – next or previous layer).
Relative Selection Layer Keycuts:
Select/target front (top) layer = Option + .
Select/target next layer up = Option + ]
Select/target next layer down = Option + [
Select/target back (bottom) layer = Option + ,
Relative Move Layer Keycuts:
Move current target layer to front (top) layer = Command + Shift + ]
Move current target layer up = Command + ]
Move current target layer down = Command + [
Move current target layer to back (bottom) layer = Command + Shift + [
Windows users would swap the Command key for Ctrl and the Option key for Alt
Copy link to clipboard
Copied
Thank you.
It was the keystroke controls for scrolling up and down the layer stack that I needed, but did not know existed when I posted. Now I should be able to re-record the actions and have them work.
Copy link to clipboard
Copied
One possible sign of a well-made action is when it can be used more than once in the same document.
Indeed, this is why sometimes you will see a ridiculous amount of relative steps in actions. You could still replace this "junk" with absolute target layers, but then you'll have to rename these temporary unique names too before the end of your action, so your next run cannot select them by accident. I use a mix of both techniques (sometimes you have to anyway).
You could decide that you'll never use underscores between words for your final layer names, but when needed use underscores for your TMP_named_layers that get selected during the execution of the action. This way, your action can never select already established layers, so to speak.
Copy link to clipboard
Copied
Thank you for the information.
What I ended up doing was using the scripting steps to rename those layers where it was important and using the layer up and down keyboard shortcuts to move between layers. That removed any layer names that were important to the script itself.