javascript - How to color nested compound paths Extendscript for Illustrator CS5? -



javascript - How to color nested compound paths Extendscript for Illustrator CS5? -

i'm trying color pathitems within compoundpathitem in illustrator. object looks circle within circle. no strokes, 4 paths, 2 compoundpathitems within compoundpathitem.

when debug line: alert(doc.compoundpathitems[0])i get:-[compoundpathitem] .... makes sense because i've combined 2 compoundpathitems.

however, cannot seem access pathitems in order color them:

doc.compoundpathitems[0].compoundpathitems[0].pathitems ... errors out x_x ... alert(doc.compoundpathitems[0].pathitems.length) gives me 0 .... t-t

help me understand what's happening here please.

is object'shape outlined letter "o"? or "◎" > 2 compoundpathitems within compoundpathitem

i think path_item of compound_path_item colored @ lastly fills color parent object( = compound_path_item).

if letter "o", seek code below

#target "illustrator" var doc = app.documents[0]; var co_pathitem = doc.compoundpathitems[0].pathitems; // create colors var color1 = new rgbcolor(); color1.red = 255; var color2 = new rgbcolor(); color2.blue = 255; // fillcolor reddish co_pathitem[0].filled = true; co_pathitem[0].fillcolor = color1; $.writeln(co_pathitem[0].fillcolor.properties()); // => color1 // fillcolor bluish co_pathitem[1].filled = true; co_pathitem[1].fillcolor = color2; $.writeln(co_pathitem[1].fillcolor.properties()); // => color2 // => doc.compoundpathitems[0] colored color2(colored @ last) // pathitems[0] filled color1 yet $.writeln(co_pathitem[0].fillcolor.properties()); // => color1 object.prototype.properties = function (cr) { var self = this; var cr = cr || ", "; var props = []; (var in self) { seek { props.push(i + ":" + self[i]); } grab (e) { // props.push(i + ":" + e); } }; homecoming props.join(cr); }

javascript adobe-illustrator extendscript

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -