0
Illustrator CS6では、すべての選択を各SVGファイルにエクスポートします。 私のシーケンスはこれです。scripting document.close()method crash
- 一時的な文書に選択の目
documents.addDocument()
方法 - コピー
i
を使用して、一時的な文書を作成します。 document.exportFile()
メソッドを使用してSVGファイルとして書き出します。document.close()
メソッドを使用して、一時的な文書を閉じます。
しかし、シーケンス4になるとIllustratorがクラッシュします。 何が問題ですか?
var sel = activeDocument.selection;
var arr = new Array;
for(var i=0;i<sel.length;i++)
{
arr.push(sel[i]);
}
var preset = new DocumentPreset;
var option = new ExportOptionsSVG;
option.compressed = false;
option.fontType = SVGFontType.OUTLINEFONT;
for(var i=0;i<arr.length;i++)
{
doc = app.documents.addDocument(i,preset); //sequence 1
var item = arr[i].duplicate(); //sequence 2
item.move(doc,ElementPlacement.PLACEATEND);
expFile = new File("C:\\Users\\user\\Documents\\font project\\svg\\" + i);
doc.exportFile(expFile,ExportType.SVG,option); //sequence 3
doc.close(); //sequence 4 and it occurs crashes
}
*エクスポートディレクトリが存在し、空です。