Skip to main content
Participating Frequently
June 30, 2010
Question

Batch update links script?

  • June 30, 2010
  • 2 replies
  • 10745 views

Does anyone have a script that will auto update the links in several InDesign documents? I have 121 InDesign documents that each have two updated .ai files. When I open they ask if I want to update. I need a script that tells each one yes to update and save.

I would also like to export a pdf of each file. Being able to chose my preset and overwrite the existing pdf. Batch process of course.

Thanks!

This topic has been closed for replies.

2 replies

GabrieleLS
Inspiring
November 15, 2023

@rob day's solution (link) works perfectly. Thanks @rob day 

July 1, 2010

Please see the below script, which will update all links and it will generate ps file using your printpreset. Once the ps is generated you can drag into acrodistiller.

var printPreset;
var printPresetPath="D:\\Books\\Preset.prst";
var inputDirectory="D:\\IndFiles";
var inddFiles=new Array();

inddFiles=Folder(inputDirectory).getFiles();

//Suppress all dialogs
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.neverInteract;

for(var indCount=0; indCount < inddFiles.length; indCount++)
{
    if (String(inddFiles[indCount]).match(/\.indd$/i))
    {
        var aDoc=app.open(File(inddFiles[indCount]), true);
       
        //Links update
        aDoc.links.everyItem().update();
       
        //Removing existing printpresets
        for(var pP=0; pP < app.printerPresets.length; pP++)
        {
            var myprintPreset = app.printerPresets.item(pP);
            if (String(app.printerPresets.item(pP).name) != '[Default]')
            {
                myprintPreset.remove();
            }
        }
       
        //Adding our print preset
        printPreset=File(printPresetPath);
        app.importFile(1918071916, printPreset);
        myprintPreset=app.printerPresets.lastItem();
       
        //Generating PS in the application path
        myprintPreset.printFile = File(aDoc.filePath+'/'+String(aDoc.name).substr(0, (String(aDoc.name).length-5))+'.ps');
        aDoc.print(false, myprintPreset);
   
        //Save and close
        aDoc.close(2036691744);
    }
}

app.scriptPreferences.userInteractionLevel = UserInteractionLevels.interactWithAll;

Arivu....

Known Participant
November 26, 2010

I wanna know is there possible to have a script  that can batch update links of open files. Just update the links. Though, you have written some code here. But I don't how to use it. I have been searched it for a very long time.

And I want to learn something about indesign script. But I don't know where to start. Only indesign script. Could you show me what to do?

Thank you in advance.

Jongware
Community Expert
Community Expert
November 26, 2010

How to install and use scripts into your Indesign: http://indesignsecrets.com/how-to-install-scripts-in-indesign.php

General starting info and guides: http://www.adobe.com/products/indesign/scripting/ -- click the Scripting Resources tab, then download the Introduction, Tutorial, and In-Depth guide for your version of InDesign.