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

PS script for renaming a PNG files' "Layer 1" to the current filename not including the extension

New Here ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

I need a simple JS to that renames an active photoshop document's "Layer 1" to the current filename without the extension. 

TOPICS
Actions and scripting

Views

190

Translate

Translate

Report

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 , Mar 14, 2021 Mar 14, 2021
var doc = activeDocument;
var lay = doc.layers.getByName( "Layer 1");
lay.name=doc.name.split(".")[0];

Votes

Translate

Translate
Adobe
Community Expert ,
Mar 14, 2021 Mar 14, 2021

Copy link to clipboard

Copied

var doc = activeDocument;
var lay = doc.layers.getByName( "Layer 1");
lay.name=doc.name.split(".")[0];

Votes

Translate

Translate

Report

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
New Here ,
Mar 15, 2021 Mar 15, 2021

Copy link to clipboard

Copied

LATEST

Thank you Chuck!

Votes

Translate

Translate

Report

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