Skip to main content
December 5, 2025
Question

Old Script doesn't work with InDesign 2026.

  • December 5, 2025
  • 2 replies
  • 323 views

I have a script that no longer works with the update and I have no clue on how to fix it.

The script is supposed to open the first file in the book print (located in the C:\ folder mentioned), update the links, save and close the file and then open the next file in the book and repeat until all files are linked and saved.

 

I would appreciate any help someone can give.

 

//Set the user interaction level to NEVER

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;

 

//Perform open of a sample book

var myBook = app.open("C:\\forms\\0210.files\\zprint.indb", false),

    i, docPath, doc, j;

 

 

for (i = 0;i<myBook.bookContents.length;i++){

    docPath = myBook.bookContents[i].fullName;

    doc = app.open(File(docPath), false);

    for (j = 0; j < doc.links.length; j++) {

        doc.links.item(j).relink(File(doc.links.item(j).filePath));

    }

    doc.save(docPath);

    doc.close();

}

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;

2 replies

m1b
Community Expert
Community Expert
December 6, 2025

Hi @Jeanne29059404neby does the script throw an error? If so, what error?

 

Also, did you write this script? If so, just for my own learning could you explain what this line does?

doc.links.item(j).relink(File(doc.links.item(j).filePath));

 

It seems to "relink" the link to the same path as it currently has which—on the surface—seems useless. Does this serve to refresh something? I would expect it to fail if the linked file was missing.

- Mark

 

P.S. nothing in your script is esoteric (aside from the question I had) so that if it does fail due to a change in the latest version of Indesign, we need to file a bug report!

Mike Witherell
Community Expert
Community Expert
December 6, 2025

If it USED to work, what version did it work with?

Within the Scripts panel, you can make subfolders and park an older script in that subfolder.

Name the subfolder this way:

A 2025 script goes in a folder named Version 20.0 Scripts.

A 2024 script goes in a folder named Version 19.0 Scripts.

A 2023 script goes in a folder named Version 18.0 Scripts.

A 2022 script goes in Version 17.0 Scripts.

A 2021 script goes in Version 16.0 Scripts.

And so on back to: a CS script goes in Version 3.0 Scripts.

 

Put your older script in one of these custom folders, and probably it will work again.

Mike Witherell