Last active
August 22, 2023 19:25
-
-
Save arthurattwell/b4162d0bead352f224dd5266a9d96d5a to your computer and use it in GitHub Desktop.
InDesign Startup Script that saves an IDML copy alongside INDD automatically
This file contains 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
// This InDesign Startup Script saves an IDML copy of the INDD file you're saving. | |
// Save it in your Startup Scripts folder. For how to do that, open the tutorial | |
// for your version of InDesign here: https://www.adobe.com/devnet/indesign/documentation.html | |
// and look for the section titled 'Installing scripts'. | |
// Thanks to fabiantheblind here http://graphicdesign.stackexchange.com/a/71736/67488 | |
// for the original script, which I've adapted to work as a startup script. | |
// Set a targetengine to make this work | |
#targetengine "session" | |
function saveIDML() { | |
// Exit if no documents are open. | |
if(app.layoutWindows.length == 0) { | |
return; | |
} else { | |
// Get the current document | |
var doc = app.activeDocument; | |
$.writeln('Saving IDML of ' + doc + ' ...'); | |
// Catch errors | |
if (!doc.saved) { | |
alert('Sorry, there was a problem and the document was not saved.'); | |
exit(); | |
} | |
// Create a new .idml file name from the .indd file name | |
var inddName = doc.name; | |
var idmlName = inddName.replace("indd", "idml"); | |
// Create the new .idml file next to the .indd file | |
var theFile = File(File(doc.filePath).fsName + "/" + idmlName); | |
doc.exportFile(ExportFormat.INDESIGN_MARKUP, theFile, false); | |
} | |
} | |
// Listen for the save event | |
app.addEventListener('afterSave', saveIDML, false); |
Was just upgraded to CC 2017 and needed a script like this. It's working most of the time but occasionally having issues. I'll document them more as I test it. It launches the ExtendScript Toolkit app when saving in indesign. Has that been the case in the past?
@MCISTL Sorry, just saw your comment. Are you still having those issues?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I work with dozens of independent designers on collaborative projects, and those of us with Creative Cloud have to remember to save an IDML copy for those on earlier versions. And we often forget.
So I use this script. It runs when InDesign starts up. Then every time I save an InDesign document, it automatically saves an IDML copy alongside the INDD, in the background.