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

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support