Copy link to clipboard
Copied
Hi!
I have a Book file with multiple InDesing files. They all have some picture files placed as linked files. In case those images are modified, the links would need to be updated obviously. I know I can do it by opening the file and clicking "Update Links", but I don't want to open 57 files and click the button.
I do know how to use scripts, but I don't know how to make them. Can anyone help?
Actually, this should be a feature in InDesign Book: update all linked files in selected book documents.
Hi therodee,
You can relink all graphics by finding their status.
var myDoc = app.documents[0];
var linkImg =myDoc.links;
var filePath = "E:/SunilY/Files/Images";
for(var i = 0; i < linkImg.length; i++){
if(linkImg.status == LinkStatus.LINK_MISSING){
var imgFolder = Folder(filePath).getFiles (linkImg.name+".*");
linkImg.relink(imgFolder[0]);
}
}
Try this...
...var add = new Folder("C:/myInddFolder/");
var myFileList = add.getFiles();
for (var i = 0; i < myFileList.length; i++) {
var myFile = myFileList;
if (myFile instanceof File && myFile.name.match(/\.indd$/i)) {
//~ Open indesign file one by one and update
var myDoc = app.open(new File(add+"/"+myFiles.name));
var linkImg = myDoc.links;
var filePath = "E:/SunilY/Files/Images";
for(var i = 0; i < linkImg.length; i++){
if(linkImg
Copy link to clipboard
Copied
Here you can find the Update modified links script which should be used with the Batch processor script.
ā Kas
Copy link to clipboard
Copied
Thanks Kas, Iāll give it a try.
Copy link to clipboard
Copied
The links were broken, but I've searched and found the scripts in your wonderful repository at
http://kasyan.ho.ua/scripts_by_categories.html
After almost 12 years of Indesign, only less than a month ago I started to use scripts.
I'm amazed by the team work here in the support community and in the other forums around.
Thank you so much!
Copy link to clipboard
Copied
Hi therodee,
You can relink all graphics by finding their status.
var myDoc = app.documents[0];
var linkImg =myDoc.links;
var filePath = "E:/SunilY/Files/Images";
for(var i = 0; i < linkImg.length; i++){
if(linkImg.status == LinkStatus.LINK_MISSING){
var imgFolder = Folder(filePath).getFiles (linkImg.name+".*");
linkImg.relink(imgFolder[0]);
}
}
Copy link to clipboard
Copied
In case Images are modified but no their names, then links will get automatically updated but if you change their location and names are same then you can use above script by defining its path...
Thanks
SunilY
Copy link to clipboard
Copied
Suni,
yes they are automatically updated, if I open the documents.
Copy link to clipboard
Copied
Try this...
var add = new Folder("C:/myInddFolder/");
var myFileList = add.getFiles();
for (var i = 0; i < myFileList.length; i++) {
var myFile = myFileList;
if (myFile instanceof File && myFile.name.match(/\.indd$/i)) {
//~ Open indesign file one by one and update
var myDoc = app.open(new File(add+"/"+myFiles.name));
var linkImg = myDoc.links;
var filePath = "E:/SunilY/Files/Images";
for(var i = 0; i < linkImg.length; i++){
if(linkImg.status == LinkStatus.LINK_MISSING){
var imgFolder = Folder(filePath).getFiles (linkImg.name+".*");
linkImg.relink(imgFolder[0]);
}
}
}
}
Copy link to clipboard
Copied
var myDoc = app.documents[0];
var linkImg =myDoc.links;
for(var i = 0; i < linkImg.length; i++){
linkImg[i].update();
}