Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Batch rename top layer in many PSD files

Contributor ,
Jan 07, 2024 Jan 07, 2024

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?

TOPICS
Actions and scripting
402
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jan 07, 2024 Jan 07, 2024

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

...
Translate
Adobe
Community Expert ,
Jan 07, 2024 Jan 07, 2024

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 07, 2024 Jan 07, 2024

Thanks, worked accurately

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 07, 2024 Jan 07, 2024
LATEST
quote

Thanks, worked accurately


By @StarAG​

 

You're welcome!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines