Current Position:Home > Batch Retrieve Image links

Batch Retrieve Image links

Update:12-10Source: network consolidation
Advertisement
Hi,
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.
Cheers,
Kud

The Best Answer

Advertisement
OK, try this out:
var inFolder = Folder.selectDialog("Choose the folder that contains the InDesign documents.");
if(inFolder === null){
          exit();
var outFolder = Folder.selectDialog("Choose the folder to save the reports in.");
if(outFolder === null){
          exit();
var files = inFolder.getFiles("*.indd"),
          fileStrings = [],
          doc, i, l, link, j, k, reportFile;
app.scriptPreferences.userInteractionLevel=UserInteractionLevels.NEVER_INTERACT;
for(i = 0, l = files.length; i < l; i++) {
          doc = app.open(files[i], false);
          reportFile = File(outFolder + "/" + doc.name.replace(/\.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.name + "\",\"" + link.status.toString() + "\",\"" + link.filePath + "\"";
          doc.close(SaveOptions.NO);
          if(fileStrings.length > 1 && reportFile.open('w')){
                    reportFile.write(fileStrings.join("\r"));
                    reportFile.close();
app.scriptPreferences.userInteractionLevel=UserInteractionLevels.INTERACT_WITH_ALL;
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.
  • Batch Retrieve Image links Update:12-10

    Hi, 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

  • Acheive Batch retrieval in Static/Programatic VO Update:11-30

    Hi, Is there any way i can handle batch retrievals in Static/programmatic VO's, Suppose i have a static Vo which reads data from an external API which retrieves 50 rows per call. so i ser my VO tuning to in batches of 50, as needed. also i set queryh

  • Retrieve weblocation link of a content item Update:11-30

    how do we retrieve weblocation link of a content item via RIDC / web service? Is there any configuration settings to be done/ enforced when accessing the doc directly via weblocation link. thanksHi , Use DOC_INFO service call and then from the LocalD

  • How to retrieve the link clicked  inside an iframe ? Update:11-30

    Hi all.. I have a JSP where i have used an iframe to display the URL's dynamically. (URL's are being passed at run time) I want to retrieve the link's URL (i.e. href attribute value ) when user clicks on the link displayed inside iframe. Say for e.g.

  • How to retrieve DB links and column names details used in code Update:11-30

    Hi All, I am looking for code that will retrieve database links name, referenced object and column names used in source code within the schema. It's easy enough to find the link names using xxx_db_links / user_source, the trick part it to list the co

  • Retrieve the link from Bookmark of Report view on Enterprise Poral Update:11-30

    Hi All, We are running the BEx queries on Enterprise Portal. When I try to Bookmark a particular View of the query it says: "Bookmark 4XX9XXYJF84229XXQF2TBAZZD saved". If at a later stage I want to run the same view of the report, from where can

  • TSQL to retrieve Oracle linked server records Update:11-30

    We're porting an Oracle system to SQL server and it's not going well... Our system is a data warehouse that extracts data from an Oracle operational system. In the Oracle version we use database links to access Oracle. On SQL Server we've created a l

  • TSQL Retrieve from linked Oracle server Update:11-30

    We're porting an Oracle system to SQL server and it's not going well... Our system is a data warehouse that extracts data from an Oracle operational system. In the Oracle version we use database links to access Oracle. On SQL Server we've created a l

  • How to retrieve the link's label with HTML Editor kit? Update:11-30

    Hi all, I need to retrieve the label that is on a HREF html attribute. In other words I need to retreive the words "Home Page" from this snippet: <b>Home Page</b> I have found tutorials that show how to extract the link itself but no

  • Batch changing image links Update:11-30

    My document has about 600 images in it, and I need to make two separate versions of it. The images in the first version are named 1a, 2a, 3a, etc., and the images for the second are 1b, 2b, and so on. Is there a way, or a script, to quickly rename al