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.
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.
2 Correct answers
// select items
var input = prompt("");
for (var i = 0; i < app.selection.length; i++) {
app.selection[i].name = input + app.selection[i].name;
}
You may also take a look at this nice approach, provided by Sergey Osokin.
It has some additional options to use placeholders and consecutive numbering.
Explore related tutorials & articles
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;
}
Copy link to clipboard
Copied
Perfect! That's what i needed.
Thank you so much for your time! 🙂
Copy link to clipboard
Copied
You may also take a look at this nice approach, provided by Sergey Osokin.
It has some additional options to use placeholders and consecutive numbering.
Copy link to clipboard
Copied
Deffinetly helpfull!

