InDesign CC2014以降、パッケージにpdfとidmlを含められるようになった。
それをスクリプトで動かしてみる。
AppleScriptの用語辞書はこんな感じ。
include idml以降はオプションぽい。
package v : Packages the document.
package document
to file or text : The folder, alias, or path in which to place the packaged files.
copying fonts boolean : If true, copies fonts used in the document to the package folder.
copying linked graphics boolean : If true, copies linked graphics files to the package folder.
copying profiles boolean : If true, copies color profiles to the package folder.
updating graphics boolean : If true, updates graphics links to the package folder.
including hidden layers boolean : If true, copies fonts and links from hidden layers to the package.
ignore preflight errors boolean : If true, ignores preflight errors and proceeds with the packaging. If false, cancels the packaging when errors exist.
creating report boolean : If true, creates a package report that includes printing instructions, print settings, lists of fonts, links and required inks, and other information.
[include idml boolean] : If true, generates and includes IDML in the package folder.
[include pdf boolean] : If true, generates and includes PDF in the package folder.
[pdf style text] : If specified and PDF is to be included, use this style for PDF export if it is valid, otherwise use the last used PDF preset.
[version comments text] : The comments for the version.
[force save boolean] : If true, forcibly saves a version. Can accept: boolean (Default: FALSE).
→ boolean : True if the packaging was successful.
こんな風に書いたら動いた。
set packFol to "Macintosh SSD:Users:kanemu:Desktop:out:"
tell application "Adobe InDesign CC 2014"
activate
tell document 1
package to packFol copying fonts yes copying linked graphics yes copying profiles no updating graphics yes including hidden layers no ignore preflight errors yes creating report yes include idml yes include pdf yes pdf style "[PDF/X-1a:2001 (日本)]" version comments "v1.0" force save no
close saving no
end tell
end tell
ExtendScriptではこう。
(function(){
var packFol = new Folder('/Users/kanemu/Desktop/out');
var doc = app.documents.item(0);
doc.packageForPrint(
packFol, // to
true, // copying fonts
true, // copying linked
false, // copying profiles
true, // updating graphics
false, // including hidden layers
true, // ignore preflight errors
true, // creating report
true, // [include idml]
true, // [include pdf]
"[PDF/X-1a:2001 (日本)]", // [pdf style]
"v1.0", // [version comments]
false // [force save]
);
doc.close(SaveOptions.NO);
}());
これでOK。