Skip to main content
_wckdTall_
Inspiring
February 12, 2026
Answered

InDesign Scripting use .reinitLink() Change missing link status to modified

  • February 12, 2026
  • 1 reply
  • 38 views

I’m trying to relink files in a document without updating them so I can review them 1 by 1.

I have successfully used  .reinitLink() on a mac, but It won’t update the link status until I reopen the document. I have been able to test sucessfully with .relink, but I don’t want it to update automatically.

Example

var pathVar = "/FullPathToAsset/"
app.activeDocument.links[0].reinitLink("file:"+pathVar)

I tried using links[0].update() after reinitLink
But nothing happens. Is there a way to check links after these updates are made?

    Correct answer _wckdTall_

    @leo.r Turns out, It was a formatting thing. When I’m pulling the file paths initially, it uses a home directory path:
    ~/Desktop/Path_To_Files.psd

    It appears, reinitLink needs the a linkResourceURI, which can be corrected by passing the string path to File(), prepending “file:/”(as the path includes a leading slash already) and extracting the fsName.

    app.activeDocument.links[0].reinitLink("file:/"+File("~/Desktop/pathToFile.psd").fsName)


    Haven’t needed decodeURLComponent, switches to modified right away!
     

    1 reply

    leo.r
    Community Expert
    Community Expert
    February 12, 2026

    Do I understand correctly that you want the status of the link to be “modified” after you relink it?

     

    If so then you can do something to force it to appear modified. For example, send it the touch shell command (albeit it’ll change its modification date; the command has all kinds of options though). Or write some metadata to the file. (It’s possible there are simpler ways I didn’t think of.)

     

     

    _wckdTall_
    Inspiring
    February 13, 2026

    Yes, I the status should be “modified”. In many cases I’m changing the link, the path updates correctly, and the file size goes to zero in the links panel. I want to trigger InDesign to refresh the link info, assuming link status will change. 

    leo.r
    Community Expert
    Community Expert
    February 13, 2026

    Then you can use the methods I mentioned above.

     

    As to the “file size goes to zero in the links panel” problem, I’ve never seen this before. Do you get this when using the relink method? (I don’t know much about the reinitLink function. It’s labeled “experimental”, I only tested it briefly with mixed results and never used for any practical purpose.)