Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Batch migrate Indesign files to other fileserver

New Here ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Hi all,

 

We are migrating lot's of Indesign files to other fileservers. In this case the links inside will all change. To prevent changing them one by one in Indesign i am looking for a solution to change the links to the new fileserver location in batches. Does someone have a solution for this scenario? Probably the best solution will be something without using Indesign itself. So scripting will be fine (Microsoft enviroment). Can't imagine some companies haven't been migrating the past years to new fileservers etc without changing the paths....

 

 

TOPICS
Scripting

Views

57

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

This thread might have some useful solutions for you. 

 

https://creativepro.com/a-script-for-relinking-images/

 

Kasyan might also have some solutions: http://kasyan.ho.ua/scripts_by_categories.html

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jul 23, 2021 Jul 23, 2021

Copy link to clipboard

Copied

Hi Peter, here is I think the basic thing you need. It is a script that performs a quick modification to all missing links in the active document, based on hard coded find and replace terms that you would set.

/*
    by m1b
    posted here: https://community.adobe.com/t5/indesign/batch-migrate-indesign-files-to-other-fileserver/m-p/12195641

    Use this when your file system has changed and current links are broken.
    Set `replaceThis` and `withThis` to re-align the fill paths.
*/

var replaceThis = "OldServerName", // use regex here if necessary
    withThis = "NewServerName";


app.doScript(main, ScriptLanguage.JAVASCRIPT, undefined, UndoModes.ENTIRE_SCRIPT, "Relinker Script");

function main() {
    var _links = app.activeDocument.links;

    for (var i = 0; i < _links.length; i++) {

        // we only care about missing links I guess
        if (_links[i].status === LinkStatus.LINK_MISSING) {

            // new file by replacing text within file path
            var newLinkedFile = File(_links[i].filePath.replace(replaceThis, withThis));

            // if file exists at modified file path, relink
            if (newLinkedFile.exists) {
                _links[i].relink(newLinkedFile);
            }
        }
    }

}

There are a couple of ways that come to mind to implement it.

  1. Open each indesign file and run the script (and save the file—this could be added to the script above). Would this be a good use of Indesign Server? I've never used it, but someone experienced might comment.
  2. Put a slight variation of this script in the startup scripts folder of each Indesign application used in your organisation and it could (I think!) quietly update links of every file that was opened without bothering the user.

 

Anyway, they're my thoughts. Hope it makes some sense.

- Mark

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 25, 2021 Jul 25, 2021

Copy link to clipboard

Copied

LATEST

Thanks Mark,

 

I will add some commands to the script to open and close Indesign and test it. I will let you know if it works. Thanks again 🙂

 

Regards,

 

Peter

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines