Created
December 6, 2013 00:55
-
-
Save milligramme/7816930 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #target "InDesign" | |
| // TORIAEZU package | |
| var package_doc = function(doc) { | |
| var self = this; | |
| var ver = app.version.split('.')[0]; | |
| var pack_f_name = doc.name.replace(/\.indd$/,""); | |
| var to = File(doc.fullName.parent + "/" + pack_f_name); | |
| var copyingFonts = true; | |
| var copyingLinkedGraphics = true; | |
| var copyingProfiles = false; | |
| var updatingGraphics = true; | |
| var includingHiddenLayers = false; | |
| var ignorePreflightErrors = true; | |
| var creatingReport = false; | |
| var versionComments = "" | |
| var forceSave = false; | |
| if (!File(to).exists) { | |
| Folder(to).create(); | |
| }; | |
| // opt for CS5 or later | |
| doc.packageForPrint( | |
| to, | |
| copyingFonts, | |
| copyingLinkedGraphics, | |
| copyingProfiles, | |
| updatingGraphics, | |
| includingHiddenLayers, | |
| ignorePreflightErrors, | |
| creatingReport, | |
| versionComments, | |
| forceSave | |
| ); | |
| }; | |
| if (new File($.fileName).name==$.stack.replace(/[\[\]\n]/g,"")) { | |
| app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT; | |
| var _f = Folder.selectDialog(); | |
| if (_f) { | |
| var indds = _f.getFiles(/.+indd$/); | |
| for (var i=0, len=indds.length; i < len ; i++) { | |
| var doc = app.open(File(indds[i])); | |
| package_doc(doc); | |
| doc.close(SaveOptions.NO); | |
| }; | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment