Search code examples
adobe-indesignextendscript

How can you prevent the "Update Links" dialog to appear when opening documents from code?


I'm trying to Update Links of inDesign documents using ExtendScript, but whenever I open the document the dialog appear asking me if I want to update the link.

I want to do it in the background, so is there a way to prevent this or any dialog from showing?

Thanks


Solution

  • I have found a solution for this particular dialog. This prompt can be disabled from the UI, but also, as with other setting of the application, you can also do in the code.

    So here is what I implemented.

    //Save the current application setting.
    var currentAppSettings = {checkLinksAtOpen: app.linkingPreferences.checkLinksAtOpen};
    
    //Set the value to false to prevent the dialog from showing.
    app.linkingPreferences.checkLinksAtOpen = false;
    
    //do some stuff ...
    
    //Set the value back to its original value.
    app.linkingPreferences.checkLinksAtOpen = currentAppSettings.checkLinksAtOpen;