我正在尝试使用JavaScript在Illustrator 5.1中创建符号或将选定的对象复制到符号中,但没有成功。以下是我的代码:
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
}
请帮我解决这个问题。 谢谢!