Script to Add File Extensions to Multiple Layers
Copy link to clipboard
Copied
Hi all, I'm having a hard time coming up with a quick scripting solution to help my team. We have files with 50-100 layers inside of Photoshop. We'd like to find a solution to add a .jpg file extension to the name of each layer without typing it out manually. I've found some scripts that add a generic suffix to one layer at a time, but it's not the right solution for us. For furter clarification, we don't want to overright the full name of each layer, we just want to add a file extension to each one so it exports correctly when we generate assets. Also, if anyone wants to go a step further, I would be very very interested if someone could come up with a way to add an extension to a selected group of layers in Photoshop. For example, if I selected 60 layers out of 100, ran the script, and suddenly had 60 layers renamed with a .png extension, leaving me with 40 layers with no extension at all, that would open up some really interesting workflows for us. Thanks, any responses/ideas will be super appreciated.
Explore related tutorials & articles
Copy link to clipboard
Copied
Are your layers in groups/layer sets? If not, it's just a simple loop through the layers, where you have the current layer name equal itself and the .jpg extension. On my phone right now, which isn't very easy to type out code, and see if it works.
Copy link to clipboard
Copied
I wonder if you'd be able to provide the code example when time permits? I'd really like to try this idea, but sadly my knowledge of javascript is quite limited.
Copy link to clipboard
Copied
One good option here from Paul Riggott - Layer Name Edit:

