Skip to main content
Participant
July 30, 2015
Question

Change links for multiple InDesign files

  • July 30, 2015
  • 2 replies
  • 1264 views

Hello Folks,

Here's the situation. We are changing our organizations file structure in a dramatic way. We are removing mapped drives, eg. H:\, and replacing them with shortcuts that will reside in their Windows Explorer that link to \\fs\marketing for example.

We have hundreds, if not thousands, of InDesign files across our organization that are probably not properly packaged when they were done with them. Is there a way to either update the links all at once using a script or being able to run a script when the user opens the InDesign file to map to the new location. It won't be a dramatic change, it'll be something simple like:

H:\DEPT\marketing\project\image.jpg  will change to   \\fs1\marketing\project\image.jpg

I'm not an InDesign user, just the IT person in charge of getting ready for this change which is why I'm asking here. The link above is only an example of the link, I don't know what the actual links would be. I found a few scripts on here for changing links, but I don't think they are designed to perform a change like this.


We are a Windows only organization. All end users are running Windows 7 64 bit.

Any help/suggestions/ideas would be greatly helpful and appreciated!

This topic has been closed for replies.

2 replies

Vamitul
Legend
July 31, 2015

See here:
Path change

Inspiring
July 31, 2015

Try this

var cur_doc=app.activeDocument;

var myf=Folder.selectDialog("Choose folder for Art File");

all_val=diaVal()

inVal=all_val[0];

outVal=all_val[1];;

var indFils=myf.getFiles("*.indd");

linkProc(cur_doc)

function linkProc(cur_doc)

{

    for (no_link=0;no_link<cur_doc.links.length;no_link++)

    {

        if (cur_doc.links[no_link].name.match(inVal))

        {

            var folPath=cur_doc.links[no_link].name;  

            folPath=folPath.replace(inVal,outVal);

            cur_doc.links[no_link].relink(File(myf+"/"+folPath));

        }

    }

}

function diaVal()

{   

    var myWindow = new Window ("dialog", "Form");

    var myInputGroup = myWindow.add ("group");

    myInputGroup.add ("statictext", undefined, "Find text");

    var myText = myInputGroup.add ("edittext", undefined);

    myText.characters = 10;   

    myText.active = true;

    var myOutputGroup = myWindow.add ("group");

    myOutputGroup.add ("statictext", undefined, "Replace text");

    var myText1 = myOutputGroup.add ("edittext", undefined);

    myText1.characters = 10;

    var myButtonGroup = myWindow.add ("group");

    myButtonGroup.alignment = "right";

    myButtonGroup.add ("button", undefined, "OK");

    myButtonGroup.add ("button", undefined, "Cancel");

    if (myWindow.show ()==1)

    {

    var inputVal =myText.text;

        var outputVal =myText1.text;

        return [inputVal,outputVal];

    }

    else

    {

        exit(0);

    }

}

Participant
July 31, 2015

Thanks for the script, I will give this a go. Will this scan our directories and update every InDesign file or will this script run when InDesign launches? I apologize for not being more versed with InDesign.

Inspiring
August 1, 2015

It will work only active document.

open the document and run the script and choose art path