Can someone share script that adds text in front of object names in layers.

Explorer ,
Apr 14, 2022 Apr 14, 2022

Copy link to clipboard

Copied

I do have random named layers with objects inside (circles, random edged figurs etc.). Object names most of the times do not have anything in common. They can be different shapes and colours.

Adding text infront of objects - Starting point.JPG

 

Endgoal Example:

I select all objects in a layer or the layer (depends what is possible), run the script and some sort of popup comes up where I can place a text and it ads this text in front of every selected object in this layer only.

Adding text infront of objects - End Goal.JPG

TOPICS
Scripting

Views

111

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 2 Correct answers

Advocate , Apr 15, 2022 Apr 15, 2022
// select items var input = prompt(""); for (var i = 0; i < app.selection.length; i++) { app.selection[i].name = input + app.selection[i].name; }

Likes

Translate

Translate
Adobe Community Professional , Apr 15, 2022 Apr 15, 2022
You may also take a look at this nice approach, provided by Sergey Osokin. Rename Items It has some additional options to use placeholders and consecutive numbering.

Likes

Translate

Translate
Advocate ,
Apr 15, 2022 Apr 15, 2022

Copy link to clipboard

Copied

// select items
var input = prompt("");
for (var i = 0; i < app.selection.length; i++) {
    app.selection[i].name = input + app.selection[i].name;
}

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
Explorer ,
Apr 15, 2022 Apr 15, 2022

Copy link to clipboard

Copied

Perfect! That's what i needed.

 

Thank you so much for your time! 🙂

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
Adobe Community Professional ,
Apr 15, 2022 Apr 15, 2022

Copy link to clipboard

Copied

You may also take a look at this nice approach, provided by Sergey Osokin.

 

Rename Items

 

It has some additional options to use placeholders and consecutive numbering.

 

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
Explorer ,
Apr 18, 2022 Apr 18, 2022

Copy link to clipboard

Copied

LATEST

Deffinetly helpfull!

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