Hi, I have added the code into your script ( and cleaned up your script a wee bit, to make it easier to follow). hope this does what you want. let us know if you have any further questions. #target indesign // script wide variable // we need a document for just about everything // so declare it at the top var curDoc = null // as we need a document // and we want to check fonts and images are correct, // do that first if (app.documents.length < 1) { alert (" There are no active documents to work on") // as we need a document, stop the script exit(); } else { // we have a document // but lets check that it is suitable for us to use curDoc = app.activeDocument; // check for missing links // get the status of links in a string, there are other status' you might need to check // options are //LinkStatus.NORMAL //LinkStatus.LINK_OUT_OF_DATE //LinkStatus.LINK_MISSING //LinkStatus.LINK_EMBEDDED //LinkStatus.LINK_INACCESSIBLE var statusString = curDoc.links.everyItem().status.toString(); if ( statusString.indexOf ("LINK_MISSING") !== -1) { alert (" Document has missing images"); exit(); } // check for missing fonts // get that status of the fonts and check, you need to pick the options from below to make sure you catch what you want. // options are // FontStatus.INSTALLED //FontStatus.NOT_AVAILABLE //FontStatus.FAUXED //FontStatus.SUBSTITUTED //FontStatus.UNKNOWN var fontStatus = curDoc.fonts.everyItem().status.toString(); if (( fontStatus.indexOf("NOT_AVAILABLE ") !== -1) || ( fontStatus.indexOf("SUBSTITUTED") !== -1 )) { alert ("Document appears to have missing fonts"); exit(); } } //=============== metatagging =============================== //-----document title and copyright--------- with (curDoc.metadataPreferences){ copyrightInfoURL = "ABC company" copyrightNotice = "© 2018 ABC company"; copyrightStatus = CopyrightStatus.yes; documentTitle = curDoc.name.split(".indd")[0]; } //---------------------add document name------------------------------- with (curDoc.metadataPreferences){ documentTitle = curDoc.name.split(".indd")[0]; } //-----------------------images to keywords--------------------------// curDoc.metadataPreferences.keywords = ["ABC company"].concat(app.activeDocument.links.everyItem().name); //-------------open file info dialog box--------------------- app.menuActions.itemByID(89092).invoke() //======================= packaging- ===================================- // Package.jsx // // by Keith Gilbert // gilbertconsulting.com // blog.gilbertconsulting.com // // Revised 2018-01-15 // // Check to see whether any InDesign documents are open. // If no documents are open, display an error message. ///Prompt the user for the folder var myTargetFolder = Folder.selectDialog("Select the folder in which to place the packaged files"); if (myTargetFolder != null) { // Package the file curDoc.packageForPrint ( to = myTargetFolder, copyingFonts = true, copyingLinkedGraphics = true, copyingProfiles = true, updatingGraphics = true, includingHiddenLayers = false, ignorePreflightErrors = true, // If this is set to false, and there are preflight errors, the script does nothing. creatingReport = false, includeIdml = false, includePdf = false, pdfStyle = "", useDocumentHyphenationExceptionsOnly = true, // Added to DOM in CC 2018 versionComments = "", forceSave = true, ) } else { exit(); } //================= make the PDFs ===================================================== preset1 = app.pdfExportPresets.itemByName("press spreads and crops"); preset2 = app.pdfExportPresets.itemByName("smallest size_spreads"); if (!(preset1.isValid && preset2.isValid)){ alert("One of the presets does not exist. Please check spelling carefully."); exit(); } mDocName = curDoc.name.substr (0, curDoc.name.lastIndexOf('.')); mSourcePath = curDoc.fullName.parent.toString(); mRootPath =mSourcePath.substr (0, mSourcePath.lastIndexOf('/')); mTargetPath=mRootPath.concat('/Final_Art/LowRes_PDF_Final/'); mNameWeb= mTargetPath.concat(mDocName,'_LOW.pdf'); mTargetPath=mRootPath.concat('/Final_Art/Print_PDF/'); mNamePrint = mTargetPath.concat(mDocName,'.pdf'); if (!d.saved){ d.save; } d.exportFile(ExportFormat.PDF_TYPE, new File(mNamePrint), false, preset1); d.exportFile(ExportFormat.PDF_TYPE, new File(mNameWeb), false, preset2); Regards Malcolm [editied : to correct forntStatus if statement]
... View more