Copy link to clipboard
Copied
Scripters: FWIW I just noticed that the "packageForPrint" method has a new parameter in the CC 2018 object model: "useDocumentHyphenationExceptionsOnly", which was sorely lacking in previous versions, despite this being present in the UI for many years. I only noticed because its sudden presence broke one of my scripts.
Copy link to clipboard
Copied
Keith_Gilbert wrote
… I only noticed because its sudden presence broke one of my scripts.
Hi Keith,
I could see it coming. Sigh…
The change will break some scripts, because the new argument is not at the end of all the other arguments:
https://www.indesignjs.de/extendscriptAPI/indesign13/#Document.html#d1e49256__d1e54411
Regards,
Uwe
Copy link to clipboard
Copied
Hi Keith,
I've noticed this too: recently wrote a script for packaging files.
Here are bits of code related to the "packageForPrint" method. Theoretically it should work in all possible versions: from CS to CC 2018.
var appVersion = Number(String(app.version).split(".")[0]), // the InDesign version number
var packageAllDocsFolderPath = doc.filePath.absoluteURI + "/Archive/", // the path to the folder where the active document is located
copyingFonts = false, // copyingFonts - Boolean - If true, copies fonts used in the document to the package folder.
copyingLinkedGraphics = true, // copyingLinkedGraphics - Boolean - If true, copies linked graphics files to the package folder.
copyingProfiles = false, // copyingProfiles - Boolean - If true, copies color profiles to the package folder.
updatingGraphics = true, // updatingGraphics - Boolean - If true, updates graphics links to the package folder.
includingHiddenLayers = true, // [Unavailable in CS3, for some reason] includingHiddenLayers - Boolean - If true, copies fonts and links from hidden layers to the package.
ignorePreflightErrors = true, // ignorePreflightErrors - Boolean - If true, ignores preflight errors and proceeds with the packaging. If false, cancels the packaging when errors exist.
creatingReport = false, // creatingReport - Boolean - If true, creates a package report that includes printing instructions, print settings, lists of fonts, links and required inks, and other information.
includeIdml = true, // [Only CC 2014 (ver.10) and above] includeIdml - Boolean - If true, generates and includes IDML in the package folder. (Optional)
includePdf = true, // [Only CC 2014 (ver.10) and above] includePdf - Boolean - If true, generates and includes PDF in the package folder. (Optional)
pdfStyle = "[High Quality Print]", // [Only CC 2014 (ver.10) and above] pdfStyle - String - 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. (Optional)
useDocumentHyphenationExceptionsOnly = false, // [Only CC 2018 (ver.13) and above] useDocumentHyphenationExceptionsOnly - Boolean - If this option is selected, InDesign flags this document so that it does not reflow when someone else opens or edits it on a computer that has different hyphenation and dictionary settings. (Optional)
versionComments = undefined, // [Only CS3 (ver. 5) and above] versionComments - String - The comments for the version. (Optional)
forceSave = undefined; // [Only CS3 (ver. 5) and above] forceSave - Boolean - If true, forcibly saves a version. (Optional) (default: false)
if (appVersion >= 13) { // Version CC 2018 and above
result = doc.packageForPrint(packageDocFolder, copyingFonts, copyingLinkedGraphics, copyingProfiles, updatingGraphics, includingHiddenLayers, ignorePreflightErrors, creatingReport, includeIdml, includePdf, pdfStyle, useDocumentHyphenationExceptionsOnly, versionComments, forceSave);
}
else if (appVersion >= 10 && appVersion <= 12) { // Version CC 2014 -- CC 2017
result = doc.packageForPrint(packageDocFolder, copyingFonts, copyingLinkedGraphics, copyingProfiles, updatingGraphics, includingHiddenLayers, ignorePreflightErrors, creatingReport, includeIdml, includePdf, pdfStyle, versionComments, forceSave);
}
else if (appVersion >= 6 && appVersion <= 9) { // Versions CS4 -- CC
result = doc.packageForPrint(packageDocFolder, copyingFonts, copyingLinkedGraphics, copyingProfiles, updatingGraphics, includingHiddenLayers, ignorePreflightErrors, creatingReport, versionComments, forceSave);
}
else if (appVersion == 5) { // Version CS3
result = doc.packageForPrint(packageDocFolder, copyingFonts, copyingLinkedGraphics, copyingProfiles, updatingGraphics, ignorePreflightErrors, creatingReport, versionComments, forceSave);
}
else if (appVersion >= 3 && appVersion <= 4) { // Versions CS -- CS2
result = doc.packageForPrint(packageDocFolder, copyingFonts, copyingLinkedGraphics, copyingProfiles, updatingGraphics, includingHiddenLayers, ignorePreflightErrors, creatingReport);
}
— Kas
Copy link to clipboard
Copied
Hi Kas and Keith,
note also that a bug was fixed in CC 2018 with packageForPrint() and the includePDF argument.
Versions CC 2014 to CC 2017.1: If you do a loop through all open documents and use packageForPrint() all exported PDFs always included the contents of the active document only. The obvious workaround was to change the active document.
See also here: packageForPrint --- problem when packaging all open documents - ADOBE please read
Regards,
Uwe
EDIT: Sorry folks, but the linked thread is NOT AVAILABLE ANYMORE in the new Adobe forum.
Copy link to clipboard
Copied
Thanks for the warning, Uwe! The script I wrote is a secondary one which is supposed to be run from my batch processor script so it shouldn't be a problem because the 'doc' variable is reset to the active document each time.
— Kas
Copy link to clipboard
Copied
Hey there, Kas! Is there any way you have this full script you'd be willing to share? It would be much appreciated as I have been tasked with packaging 30-35k InDesign files. Thanks in advance!!