Skip to main content
Participating Frequently
May 21, 2024
Answered

Layer name used to save file with Action or Script

  • May 21, 2024
  • 3 replies
  • 1424 views

Hi there, 

I’m new to posting in the community. 
I’m hoping for some advice or assistance in setting up an action or a script to do the following.

I have a PSD template that I have set up an action to drop a PNG file into the bottom layer. 

What I need is an automation of some sort that inserts the name of the Layer that I just dropped into the template to be added to the front of the PSD file name and saved as a jpeg for web. 

I have just got my head around Actions, and Scripts are quite advanced for me.  🙂

This topic has been closed for replies.
Correct answer Stephen Marsh

I forgot to mention, that the other way to do this is to use Layer Comps, saving each comp with the name you require, then use the default Export Layer Comps to Files script.

 

https://helpx.adobe.com/au/photoshop/using/layer-comps.html

 

3 replies

Stephen Marsh
Community Expert
May 23, 2024

@AEL-13 - So how did things go?

Stephen Marsh
Stephen MarshCorrect answer
Community Expert
May 21, 2024

I forgot to mention, that the other way to do this is to use Layer Comps, saving each comp with the name you require, then use the default Export Layer Comps to Files script.

 

https://helpx.adobe.com/au/photoshop/using/layer-comps.html

 

Stephen Marsh
Community Expert
May 21, 2024

You'll need a script for the final save JPEG step, as including a layer name in the final file name is beyond actions or batch commands.

 

This could be a custom script, or an all purpose, generic layer saving script.

 

It might be better to have the whole action re-created as a script, rather than having a hybrid action that relies on a script? That is of course up to you, I'm happy to help, but I would need to see a screenshot of the action steps with each step expanded/disclosed and or have access to the action if it is too complicated to decipher from the screenshot.

 

When you "drop in" (how – File > Place or something else?) the PNG file into the template, what is the name of the layer? Is it the filename of the PNG? Can you post a screenshot of the layers panel?

 

 

AEL-13Author
Participating Frequently
May 21, 2024

Hey Stephen, 
Thanks for replying. 

Here is a Screen Shot. 

The layer called Abstract Art 53 is the layer that I have dropped in. 
I play an action that turns each folder on and off and saves it in jpg for web with the Abstract Art - 53 (or other files I drop in, in it's place) behind the folder layers. 

What I am trying to achieve is to insert the Abstract - 53 layer name in front of the PSD files name when i run the action I mentioned above for saving the jpg. 

DId that make sense?

 

Stephen Marsh
Community Expert
May 21, 2024

Apoligies for the delay. I just needed to double check the action was working ok. 

I've attached a screen shot. 

To add to the file name saving I just released I also need the following format as it moves through the action. 

"Smart Object Layer Name" - "Folder Layer Name" - PSD File Name.jpg 


Ah, then having the layer selected is irrelevant then, as this is about using the visible groups and layers to set the save name.

 

Can you screenshot a couple of examples of the layer visibility on with corresponding filenames typed out so that the relationship is obvious.