Edit symbol in Illustrator using javascript
I am trying to create a symbol or copy selected objects to a symbol in Illustrator 5.1 using JavaScript with no success. Here is my code:
sourceDoc.selection = null; // deselect everything
sourceDoc.selectObjectsOnActiveArtboard(); // select all in artboard
sel = sourceDoc.selection;
sourceDoc.symbols.add(sel); // <--- NOT WORKING
for (k=0; k<sel.length; k++) {
var newItem = sel[k].duplicate(destDoc.symbols.getByName("Symbol1"),ElementPlacement.PLACEATEND);
//^^^^ NOT WORKING
}
Please help me how to fix this. Thank you!
+3
source to share