Deleting and replacing layers
so i'm trying create simple script measure size of art on artboard making printing plates. part have working. once have made 1 file, have delete measurements layer manually (which script puts them) can make next one. need script check , see if there layer called "measurements" delete it , create new 1 called "measurements" in put dimensions of (new) artwork. way can keep making files , "saving as" new name.
here's sample
var idoc = app.activedocument; // try removing layer, regardless whether exists or not try { var ilayer = idoc.layers["measurements"]; // if not exist, error out.... ilayer.remove(); } catch(e) { } // ....and continue here, doing nothing // add new layer var ilayer = idoc.layers.add(); ilayer.name = "measurements";
More discussions in Illustrator Scripting
adobe
Comments
Post a Comment