Problem with Selecting Layers in Illustrator JSX Script for Renaming
Hello,
I’m working on an Illustrator JSX script where I want to rename selected layers according to certain rules. However, I am having trouble getting the selected layers. I’ve tried using selection and other methods, but they don’t seem to work as expected. Here’s the code snippet I’ve been using:
var doc = app.activeDocument;
var selectedLayers = doc.selection;
But doc.selection is not returning the selected layers as expected. Can anyone help me with the correct way to get the selected layers in Illustrator for renaming purposes? Any suggestions or examples would be greatly appreciated!
Thank you in advance!
