2016-09-08 2 views
0

Es gibt einige compoundPathItems in myfile.aiStellen zusammengesetzten Pfad in Adobe Illustrator von Skript

Wie kann ich "Objekt> zusammengesetzten Pfad> Make" oder schicken Sie "Strg + 8" von jsx laufen? In Zeile mit Kommentar ERROR HIER bekomme ich Fehlermeldung "Ein neues Objekt kann nicht am angegebenen Ort erstellt werden".

#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[i].selected = true; 
    } 

    var selection = app.activeDocument.selection; 
    for (var i=0; i<selection.length; i++) { 
     selection[i].move (cp, ElementPlacement.PLACEATEND); // move selected path inside the compound path ERROR HERE 
     selection[i].evenodd = true; // necessary to determine "insideness" or to make holes. 
    } 

    alert(selection); 

Antwort

0
app.executeMenuCommand("compoundPath"); 
Verwandte Themen