Copy link to clipboard
Copied
Hello community,
I have searched everywhere for a script that changes all layers in Illustrator 2024 to the same colour.
The script I found is below but for some reason it doesn't work (no errors appear - just does nothing).
Copy link to clipboard
Copied
When updating the forum, the indexes of array elements disappeared in the old scripts. It was missing var aLay = layers[i].
var doc = app.activeDocument;
var layers = doc.layers;
var LightBlueCol = new RGBColor();
LightBlueCol.red = 79;
LightBlueCol.green = 128;
LightBlueCol.blue = 255;
for (var i = 0; i < layers.length; i++) {
var aLay = layers[i];
aLay.color = LightBlueCol;
// aLay.name = LightBlueCol + (layers.length - i).toString();
}
Copy link to clipboard
Copied
Perfect!
Thank you so much Sergey.
I tried changing a few lines myself but don't have enough knowledge of Javascript to make it work.