Current position:  Home > Default > Batch Retrieve Image links

Batch Retrieve Image links

Time:December 10
I've found the File -> Package -> Report quite helpful for generating a detailed report for image links. However I am dealing with a few hundred files so the act of going into each one and generating a report individually is quite time consuming. I have been able to reduce the overall time by a) customing the hotkey for accessing the Package and b) memorizing the keystrokes required to complete each report however I can't help but think there has to be an easier way.
My assumption is that there would be a way to script such a simple action so that I could simply hit play and have the file generated, am I correct?
If not my second assumption is it would be easier to troll through the XML files and parse the links that way?
Thank-you very much in advance for any and all support in this matter.
OK, try this out:
var inFolder = Folder.selectDialog("Choose the folder that contains the InDesign documents.");
if(inFolder === null){
var outFolder = Folder.selectDialog("Choose the folder to save the reports in.");
if(outFolder === null){
var files = inFolder.getFiles("*.indd"),
          fileStrings = [],
          doc, i, l, link, j, k, reportFile;
for(i = 0, l = files.length; i < l; i++) {
          doc =[i], false);
          reportFile = File(outFolder + "/" +\.indd$/,"") + ".csv");
          fileStrings = ["\"link\",\"status\",\"complete name\""];
          for(j = 0, k = doc.links.length; j < k; j++) {
                    link = doc.links[j];
                    fileStrings[fileStrings.length] = "\"" + + "\",\"" + link.status.toString() + "\",\"" + link.filePath + "\"";
          if(fileStrings.length > 1 &&'w')){
So, this will ask you to choose the folder that contains the InDesign documents you want link reports on. It won't descend into subfolders. If your files aren't all in one folder, you can drag aliases/shortcuts into one folder and it should follow them. It will then ask you for a folder to save the report files in. It's set up to make one .csv for each document, and it doesn't produce them for documents that have no links.
Let me know if the file format I've chosen doesn't work for you, or if you'd rather have all of it in one document, or more fields, or whatever.
Tested on CS5 on the Mac.