Skip to main content
Inspiring
Feb 18, 2026 10:05 AM UTC
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.

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).

    Manan JoshiCorrect answer
    Community Expert
    Feb 18, 2026 10:44 AM UTC

    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

    13 replies

    Dave Creamer of IDEAS
    Community Expert
    Community Expert
    Feb 18, 2026 1:47 PM UTC

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

    Translate
    David Creamer: Community Expert (ACI and ACE 1995-2023)
    MrZZYAuthor
    Inspiring
    Feb 18, 2026 1:53 PM UTC

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

    Translate
    Dave Creamer of IDEAS
    Community Expert
    Community Expert
    Feb 18, 2026 2:56 PM UTC

    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. 

    Translate
    David Creamer: Community Expert (ACI and ACE 1995-2023)
    rob day
    Community Expert
    Community Expert
    Feb 18, 2026 1:27 PM UTC

    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()
    }

     

     

     

     

    Translate
    Manan JoshiCommunity ExpertCorrect answer
    Community Expert
    Feb 18, 2026 10:44 AM UTC

    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);
    }
    }

     

    Translate
    -Manan
    Community Expert
    Feb 18, 2026 10:52 AM UTC

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

    Translate
    Community Expert
    Feb 18, 2026 10:54 AM UTC

    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

    Translate
    -Manan
    Community Expert
    Feb 18, 2026 10:17 AM UTC

    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);
    }
    }

     

    Translate
    MrZZYAuthor
    Inspiring
    Feb 18, 2026 10:21 AM UTC

    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.

    Translate