Tuesday, March 06, 2012

Select Compound Paths only

I got a request today to write a script that selects only compound paths. Here's the quickie script:


var doc=activeDocument;
var sel = doc.selection;

var len = sel.length;

while(len--)
{
 
        if(sel[len].typename ==="CompoundPathItem"){
            sel[len].selected=false;
            }
}
 
alert("Only non-compound items are selected."); 
 


It should work for all versions of illustrator, and can easily be modified to other object types.

enjoy!

-J

1 comment:

John said...
This comment has been removed by the author.