Filter page items by property in Javascript
what javascript equivalent applescript?
set xxx every page item note = "john"
after looking @ of tutorials, pieced together. there better way of doing this? 30,000 path items took on minute execute...
docref = app.activedocument;
var pathlength = docref.pathitems.length;
docref.pathitems[0].note;
var hitlist = []
for (i = 0; i<pathlength; i++)
{
if (docref.pathitems[i].note= "john")
{
hitlist.push(i)
}
}
alert(hitlist.length)
no better way think, shouldn’t if (docref.pathitems[i].note == "john") ?
and if want length, there no need create array, increase count ok, maybe little faster.
More discussions in Illustrator Scripting
adobe
Comments
Post a Comment