Skip to main content
Known Participant
December 20, 2021
Answered

Change default background layer to original file name

  • December 20, 2021
  • 3 replies
  • 2357 views

When I import a file into photoshop, can I have the "background" layer show the PSD file name? 

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

Yes it works. The basic script is installed by default with Photoshop. More on Script Events Manager here:

 

https://prepression.blogspot.com/2021/10/photoshop-script-events-manager.html

 

EDIT: Recently discussed in this recent topic thread -

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/script-for-open-as-layer-without-file-extension/m-p/12594732

 

3 replies

Stephen Marsh
Community Expert
December 20, 2021

A conditional action can check for the Background layer and promote it to a standard layer, it just can't name it after the open document name, a script is required for that. This is one of the "rare" cases where the conditional actions are useful:

 

 

 

ipv1Author
Known Participant
December 20, 2021

I think this is what I'm looking for 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/renaming-a-layer-with-the-file-name/td-p/10531371

 

Does anyone know if this works for 23.1.0? 

* Inventory: Photoshop v 24.3.0; M1 Mac Mini, Ventura 13.2.1, 1 TB SSD, 16 GB RAM; Wacom Intuos Pro M
Stephen Marsh
Stephen MarshCorrect answer
Community Expert
December 20, 2021

Yes it works. The basic script is installed by default with Photoshop. More on Script Events Manager here:

 

https://prepression.blogspot.com/2021/10/photoshop-script-events-manager.html

 

EDIT: Recently discussed in this recent topic thread -

 

https://community.adobe.com/t5/photoshop-ecosystem-discussions/script-for-open-as-layer-without-file-extension/m-p/12594732

 

ipv1Author
Known Participant
December 21, 2021

That was perfect! Thanks! Is it possible to add "lock layer" step to the end of that script? 

* Inventory: Photoshop v 24.3.0; M1 Mac Mini, Ventura 13.2.1, 1 TB SSD, 16 GB RAM; Wacom Intuos Pro M
Brainiac
December 20, 2021

You don't import a file, you just open it. And a background layer can't have a different name or it won't be a background layer. I suppose you could add an empty layer to every file with the filename, but why?

ipv1Author
Known Participant
December 20, 2021

When I'm compositing, I'd like the background layer to show the original filename similiar to when you load files into a stack. 

 

 

* Inventory: Photoshop v 24.3.0; M1 Mac Mini, Ventura 13.2.1, 1 TB SSD, 16 GB RAM; Wacom Intuos Pro M
JJMack
Community Expert
December 20, 2021

You can convert  a background layer to a normal layer and name it anyway you want.  All PSD do not have a background layer.  The background layer is special bottom layer and one is not required.   You can script the process even make an open event handler. But you need to handle what you want to do when there is no background layer. You will be making all PSD to not have as background layer you will most likely open these also and If you save the PSD with a new file name will you also be renaming the bottom layer. Save even handlers are triggered after the save completes the rename can not be done by  a save even handler the documen may not longer be in Photoshop. The open event handler  can rename a bottom normal layer.  The open event handler would need to be a script so it can use logic to determine what kind of layer the bottom layer is in  a PSD file and be able to retrieve the backing file name and file type,

JJMack