Script convert to IDML - please update as you like or have any other cool ideas
I'm not the best scripter but finding bits and cobbling them together seems to be working for me so far.
I was using InDesign 2023 (moved to 2024/2025), but as newer files started coming in I had to install 2025 as well.
Opening a newer file in 2023 triggers the online conversion, but it regularly gets stuck at 33%, so I ended up having to open the file directly in 2025 (and soon, probably 2026). It worked, but it was a bit cumbersome.
So I cobbled together a small script that I now run from InDesign 2023. It asks for the file location, launches 2025, saves an IDML in the same folder, and that’s it — no fuss.
I did try to:
-
automatically close 2025 afterwards (gave up on that), and
-
open the resulting IDML automatically (I’ve associated IDMLs with 2023 at OS level), but I couldn’t get that working either.
Still, with a bit of BridgeTalk experimentation and some trial-and-error, this is where I landed, and I’m about 99% happy with it.
First things first:
Run this small script in the version of InDesign you want to target for the conversion:
alert(BridgeTalk.appSpecifier);
It should return something like
Screenshot 2025-12-24 at 09.41.54.png
Then in the script below - you can insert the version in the bt-target
"bt.target = "indesign-20.064"; // Confirmed target for 2025"
// Ask for a file
var f = File.openDialog("Select InDesign file to convert to IDML");
if (!f) exit();
// Determine output IDML path
var output = f.fsName.replace(/\.indd$/i, ".idml");
// BridgeTalk message to InDesign 2025
var bt = new BridgeTalk();
bt.target = "indesign-20.064"; // Confirmed target for 2025
bt.body = "\
(function(){ \
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT; \
var f = File(\"" + f.fsName + "\"); \
var doc = app.open(f); \
doc.exportFile(ExportFormat.INDESIGN_MARKUP, File(\"" + output + "\")); \
doc.close(SaveOptions.NO); \
})();";
// When 2025 reports back, open the new IDML here in 2023
bt.onResult = function(res){
var idml = File(output);
if (idml.exists) {
app.open(idml);
alert("Done. IDML opened in 2023.");
} else {
alert("IDML was not found. Something went odd.");
}
};
bt.onError = function(err){
alert("Error: " + err.body);
};
bt.send();
P.s. I need to be in 2023 for a specific reason, so need to convert newer files back, but will be moving up versions soon.

