ドキュメントの全ページを単ページでPDFに書き出すJavaScriptです。
InDesignに定義されているプリセットを使うので「mofmof」の部分をご自分のInDesignに登録しているプリセットの名前にして使ってください。
スクリプトの最初に
var mofmof = "[PDF/X-1a:2001 (日本)]"
っていうのを付け加えて見やすくするのもアリかな。
pages[j].nameで適用されているセクションがとれるとは知らなかった。
alert("フォント不足、画像のリンク切れor更新もれがあった際は処理を終了します") ;try {
folderObj = Folder.selectDialog("inddファイルのあるフォルダを選択してください");
saveObj = Folder.selectDialog("PDFを保存するフォルダを選択してください");
fileList = folderObj.getFiles("*.indd");
for (i=0; i
fileObj = new File(fileList[i].fsName);
app.open(File(fileObj));
var docObj = app.activeDocument ;
var docName = docObj.name ; //ドキュメントの名前を取得
var replaceName = docName.replace(/.indd/g, "") ; //ドキュメントの名前から.inddを削除(置換してる)
for (j = 0 ; j
var mySection = docObj.pages[j].name
app.pdfExportPreferences.pageRange=mySection
docObj.exportFile(ExportFormat.pdfType, File(saveObj+"/"+replaceName+"_"+ mySection +".pdf"), false, "mofmof");
}
docObj.close(SaveOptions.no);//
}
alert(fileList.length+"ファイルを処理しました")
} catch(e) {
alert(e+"\n処理を中止します") ;
exit() ;
}