Add some text to end of a layer name

Engaged ,
Sep 05, 2022 Sep 05, 2022

Copy link to clipboard

Copied

How i can duplicate layer and rename it on that way to contain current layer name + some specific text?  For example if layer name is Background,  i want to name duplicated layer Background retouched.

TOPICS
Actions and scripting

Views

46

Likes

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 , Sep 05, 2022 Sep 05, 2022

If the name varies this would need a Script. 

Do you have experience with JavaScript? 

 

Edit: 

if (app.documents.length > 0) {
var theLayer = app.activeDocument.activeLayer;
var theCopy = theLayer.duplicate();
theCopy.name = theLayer.name + "_ret";
app.activeDocument.activeLayer = theCopy
};

Likes

Translate

Translate
Community Expert ,
Sep 05, 2022 Sep 05, 2022

Copy link to clipboard

Copied

LATEST

If the name varies this would need a Script. 

Do you have experience with JavaScript? 

 

Edit: 

if (app.documents.length > 0) {
var theLayer = app.activeDocument.activeLayer;
var theCopy = theLayer.duplicate();
theCopy.name = theLayer.name + "_ret";
app.activeDocument.activeLayer = theCopy
};

Likes

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