Copy link to clipboard
Copied
Hi all,
Can anyone let me know if it's possible to create a script or action to prompt for a word to be entered, then add that name to all layers, or specific layers, or replace a specific word if it exists in layers.
e.g. I'm creating a template with generate image assets enabled so I can quickly and easily generate a predefined set of image sizes / formats etc. just from dropping the image into a smart layer.
That's all sorted and working - but I'd like to be able to specify the filenames based on the main image rather than having to rename layers individually and manually.
So I'd have
Template Names Saved layer names
50x50.jpg New Logo 50x50.jpg
50x50.png New Logo 50x50.png
1000x1000.png New Logo 1000x1000.png
So rather than having to add "New Logo" or whatever the filename needs to be based on the project, I could just enter it once and then they get updated?
I hope that makes sense!
Fingers crossed
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Yes - but must not have searched well, I was getting all sorts of unrelated results.
Thanks - checking it out now...
Copy link to clipboard
Copied
This looks almost exactly what I'm looking for - though I don't want it numbering the layers - I'll see if I can edit the script to stop that happening - though scripts aren't my forte!
Thanks again
Copy link to clipboard
Copied
In fact - it's not quite enough for what I needed, just realised I should have specified I also need it to do groups as well as layers... I knew I'd miss something!
Copy link to clipboard
Copied
The script looks pretty simple, can you post screenshots of a beginning document, and finished, and point out what was missed or needs to be changed? We would need to see the expanded layers panel.
Copy link to clipboard
Copied
@Big Rick Cowell – Try this script, it works on both layers and layer groups:
https://github.com/Paul-Riggott/PS-Scripts/blob/master/Layer%20Name%20Edit.jsx
A couple of examples, either adding a new name as a prefix, or using a regular expression find/replace to to the same:
Copy link to clipboard
Copied
Thanks @Stephen_A_Marsh - I'll give that a try asap!
Copy link to clipboard
Copied
@Stephen_A_Marsh - perfect, thanks!
Copy link to clipboard
Copied
PS - just in case anyone else is using this and finds the same - the script window was pale grey on mine, so I've edited the background in the script - changing line 20 to:
var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0, 0, 0, 0]);