Answered
スクリプトで、アートボード番号を指定して配置したいのですが可能でしょうか?
スクリプトで、ほかのaiファイルを配置する際、アートボード番号を指定して配置したいのですが可能でしょうか?手動で、読み込みオプションからアートボードを選択する機能をスクリプトから実現したいと思っています。
Illustratorファイルを配置する場合はPDFを配置する事と同義ですので、以下のようにpdfOptionsのpageToOpen指定すればOKです。
var pref = app.preferences.PDFFileOptions;
pref.pageToOpen = 2; //set page number you want to place.
pref.pDFCropToBox = PDFBoxType.PDFMEDIABOX;
var pdfOptions = app.preferences.PDFFileOptions;
var obj = app.activeDocument.layers[0].placedItems.add();
var pdfile = File.openDialog('Select the PDF file', '*.pdf, *.ai');
var fl = new File(pdfile);
obj.file = fl;Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.