I import various Autocad drawings into Illustrator daily for packaging designs.
I need a java script to create 2 new layers, then name them as Dielines and ART.
I've tried the script below that creates 2 new layers but I'm not sure how to rename them?
The trial script below does not achieve a rename.
The Autocad drawings that are imported vary in the ammount of layers they contain.
Can ayone help as I'm sure there are lots of ways to achieve the result I want but I'm a newbie to this.
Many thanks in advance.
var layer1 = app.activeDocument.layers.add; layer1.name = 'Dieline'; var layer2 = app.activeDocument.layers.add; layer2.name = 'Art';
Copy link to clipboard
I have updated the @femkeblanco script, add is the method therefore it must have () brackets after add. Here you go
var layer1 = app.activeDocument.layers.add(); layer1.name = 'Dieline'; var layer2 = app.activeDocument.layers.add(); layer2.name = 'Art';
thankyou Femkeblanco This works well 🙂
Hello, I'm a newbie as well. Think I can make use of this script, if i only new how to actually download it and where to actaully place it then run it. Any guidance will be GREATLY! appreaciated. Thanks
Hola rubia, copy the script posted here, paste it in a Text Editor, save it with any name with a "*.jsx" extension.
Make sure you save as Plain Text (NOT Rich Text).
Then go to Illustrator, open a document and click on File->Scripts->Other Scripts...find the script you just saved, done.