Skip to main content
Inspiring
February 18, 2026
Answered

Is it possible to script the saving of all open InDesign documents, including those that require 'Converting' from one InDesign version to another, directly over their former versions.

  • February 18, 2026
  • 4 replies
  • 84 views

Is it possible to script the saving of all open InDesign documents, including those that require 'Converting' from one InDesign version to another, directly over their former versions.

I often need to do this with large numbers of documents, and it seems that going from one document to the next when I have 20 open documents, clicking save, being offered the ability to save the document directly over itself because InDesign helpfully opens the save point of the source doc, clicking SAVE then clicking OK, then closing the document, and moving on to the next, one, well this looks like a clear case for automation.

Given that I have my own version control and excellent backups, I don’t have to worry about overseeing every step in an operation like this (that’s to say, given that it’s a reliable script).

    Correct answer Manan Joshi

    The code shared by ​@Eugene Tyson might not work for converted documents because those documents don’t have a fullName. Not tested but if you get that error message on the console. Try the following code

    for (var i = 0; i < app.documents.length; i++) {
    var doc = app.documents[i];

    try {
    // Save the document directly over itself
    doc.save(File(doc.filePath + "/" + doc.name));
    $.writeln("Saved: " + doc.name);
    } catch (e) {
    $.writeln("Error saving " + doc.name + ": " + e);
    }
    }

     

    4 replies

    Dave Creamer of IDEAS
    Community Expert
    Community Expert
    February 18, 2026

    If it helps, the keyboard Cntl-Alt-Shift-S or Cmd-Opt-Shift-S saves all open documents. 

    David Creamer: Community Expert (ACI and ACE 1995-2023)
    MrZZYAuthor
    Inspiring
    February 18, 2026

    Thanks, but this seems to do nothing in Adobe InDesign 2026 Mac.

    Dave Creamer of IDEAS
    Community Expert
    Community Expert
    February 18, 2026

    Yes, it does--it is an InDesign KB shortcut. I’m not a scripter, but the keyboard short cut can be scripted to run when necessary. It won’t deal with files that have to be converted as they have the option to be renamed. 

    David Creamer: Community Expert (ACI and ACE 1995-2023)
    rob day
    Community Expert
    Community Expert
    February 18, 2026

    Hi ​@MrZZY , A similar approach that I use is to give this script the Command S key command—does a save as with the doc name if the active document has been converted, otherwise saves:

     

    var doc = app.activeDocument;
    try {
    var fp = doc.filePath + "/" + doc.name
    if (doc.converted) {
    doc.save (File(fp))
    } else {
    doc.save()
    }
    }catch(e) {
    doc.save()
    }

     

     

     

     

    Manan JoshiCommunity ExpertCorrect answer
    Community Expert
    February 18, 2026

    The code shared by ​@Eugene Tyson might not work for converted documents because those documents don’t have a fullName. Not tested but if you get that error message on the console. Try the following code

    for (var i = 0; i < app.documents.length; i++) {
    var doc = app.documents[i];

    try {
    // Save the document directly over itself
    doc.save(File(doc.filePath + "/" + doc.name));
    $.writeln("Saved: " + doc.name);
    } catch (e) {
    $.writeln("Error saving " + doc.name + ": " + e);
    }
    }

     

    -Manan
    Community Expert
    February 18, 2026

    Ah I usually miss the catch! Thanks - makes sense.

    Community Expert
    February 18, 2026

    We all do ​@Eugene Tyson . I recent fell in this trap on a project so I just quickly checked if you too got caught :P

    -Manan
    Community Expert
    February 18, 2026

    Actually have an old script here that I have used before but not in a long time no idea where I got it
    Remember I had it a long time ago for the same reason.
     

    // Loop through all open documents
    for (var i = 0; i < app.documents.length; i++) {
    var doc = app.documents[i];

    try {
    // Save the document directly over itself
    doc.save(doc.fullName);
    $.writeln("Saved: " + doc.name);
    } catch (e) {
    $.writeln("Error saving " + doc.name + ": " + e);
    }
    }

     

    MrZZYAuthor
    Inspiring
    February 18, 2026

    Thanks so much :)

    I’ll give this a go, I was unable to get anything to work myself using my limited scripting and some AI support. Will get back to you.