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....
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
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.
Anyway, they're my thoughts. Hope it makes some sense.
- Mark
Copy link to clipboard
Copied
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