Copy link to clipboard
Copied
Hi,
I am looking for a way to batch rename the top layer in many PSD files to say "First"
I have 100s of PSD files and I have to rename top layer on all those files to "First", how can I achieve it?
The simplest way is generic:
activeDocument.layers[0].name = "First";
However, if you don't wish to affect existing layer visibility, then another generic approach is:
if (activeDocument.layers[0].visible === false) {
activeDocument.layers[0].name = "First";
activeDocument.layers[0].visible = false;
} else {
activeDocument.layers[0].name = "First";
}
Further checks could be implemented to only affect certain specific layer kinds.
You can then record the script into an actio
...Copy link to clipboard
Copied
The simplest way is generic:
activeDocument.layers[0].name = "First";
However, if you don't wish to affect existing layer visibility, then another generic approach is:
if (activeDocument.layers[0].visible === false) {
activeDocument.layers[0].name = "First";
activeDocument.layers[0].visible = false;
} else {
activeDocument.layers[0].name = "First";
}
Further checks could be implemented to only affect certain specific layer kinds.
You can then record the script into an action, then use Automate > Batch to apply the action to multiple files.
Of course, a batch script could also be created.
Copy link to clipboard
Copied
Thanks, worked accurately
Copy link to clipboard
Copied