For backwards compatibility, I wished to batch convert all the *.indd
files on my drive to *.idml
.
The files are spread over my whole drive.
Here are the steps:
Use any search tool. Since Windows Search does not work on my side, I am using WSL:
cd /d/
find . -type f -name '*.indd'
Will output something like this..
/d/path1/xyz/x/z/file1.indd
/d/path2/xyz/x/z/file2.indd
/d/path3/xyz/x/z/file3.indd
/d/path4/xyz/x/z/file4.indd
I use notepad++ for this:
2.1 replace /d/
with D:\\
2.2 replace /
with \\
2.3 Switch to extended; replace \n
with ",\n"
var myFileList = [
"D:\\path1\\xyz\\x\\z\\file1.indd",
"D:\\path2\\xyz\\x\\z\\file2.indd",
"D:\\path3\\xyz\\x\\z\\file3.indd",
"D:\\path4\\xyz\\x\\z\\file4.indd"];
for (var i = 0; i < myFileList.length; i++) {
var myFile = myFileList[i];
app.linkingPreferences.checkLinksAtOpen = false;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
try {
app.open(myFile);
var doc = app.activeDocument;
var docPath = doc.filePath;
var docName = doc.name.replace(/\.indd$/i, "");
var idmlFile = new File(docPath + "/" + docName + ".idml");
doc.exportFile(ExportFormat.INDESIGN_MARKUP, idmlFile);
app.documents.everyItem().close(SaveOptions.NO);
}
catch(err) {
alert (myFile);
}
}
%AppData%\Adobe\InDesign\Version 18.0\en_US\Scripts\Scripts Panel\convert.jsx
(or similar)
- Open InDesign
- Go to Window/Tools/Script
- Select User Scripts/convert.jsx
The script will:
- Open all files and store
idml
files in the same folder - Close all original
indd
files afterwards (without saving) - Ignore all missing links or fonts
- Overwrite existing
idml
files - Not prompt the user under any circumstances, except for issues with opening files
Use with caution. Backup first.
This has been very helpful. Thank you.