There are some compoundPathItems in myfile.ai How can i run "Object > Compound Path > Make" or send "ctrl+8" from jsx? At line with comment ERROR HERE i get error message "A new object cannot be created at the specified location". #target illustrator if (app.documents.length > 0) { var idoc = app.activeDocument; var cp = idoc.compoundPathItems.add(); var allPaths = activeDocument.pathItems; //Select objects for(var i = 0;i < allPaths.length;i++){ allPaths.selected = true; } var selection = app.activeDocument.selection; for (var i=0; i<selection.length; i++) { selection.move (cp, ElementPlacement.PLACEATEND); // move selected path inside the compound path ERROR HERE selection.evenodd = true; // necessary to determine "insideness" or to make holes. } alert(selection);
... View more