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, How to, Mac

Views

57

Likes

translate

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

Adobe Community Professional , Mar 14, 2021 Mar 14, 2021
var doc = activeDocument; var lay = doc.layers.getByName( "Layer 1"); lay.name=doc.name.split(".")[0];

Likes

translate

Translate

Translate
Adobe Community Professional ,
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];

Likes

translate

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

Thank you Chuck!

Likes

translate

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