How to rename objects using a script
I have very little programming knowlege, but I'm trying to make a script that will rename selected objects (paths, shapes, etc). For example, I want to name all the objects selected "vinyl."
This is the code I've been trying and can't get to work:
var docRef = activeDocument;
var sel = docRef.selection;
for (var i=0; i < sel.length; i++)
sel.name = "vinyl";
I'm using Visual Studio Code with Extendscript and Extendscript Debugger. I've tried saving as a .js and .jsx file. When I run debugging, it doesn't give me any errors, but it also doesn't rename the objects. What am I doing wrong?
