0 Replies Latest reply on Jun 16, 2010 11:23 AM by jhhtz

    Help - InDesign CS2 Relink Script


      We recently updated our storage solution from two external hard drives to a large, single volume. As a result, all of the links in our InDesign documents are now broken. Links that used to point to...





      ... should now point to...





      I wrote a script that automatically fixes all of the old links. It runs fine in CS4. Unfortunately, we have 300+ CS2 documents that we only access from CS2 workstations, and the script is not working there.


      The script is below, and a screen capture of the CS2's error is below that. Any advice would be tremendously appreciated.


      var allLinks = app.documents[0].links;
      for (i = 0; i < allLinks.length; i++) {
           var thisLink = allLinks[i];
           var thisLinkPath = thisLink.filePath;
           var newLinkPath = thisLinkPath;
           if (thisLinkPath.substring(0,14) == '/Volumes/Raid1') {
                newLinkPath = thisLinkPath.replace(/\/Volumes\/Raid1/g, '/Volumes/Drobo/RAID1');
           } else if (thisLinkPath.substring(0,14) == '/Volumes/320GB') {
                newLinkPath = thisLinkPath.replace(/\/Volumes\/320GB/g, '/Volumes/Drobo/RAID2');
           } else      if (thisLinkPath.substring(0,5) == 'Raid1:') {
                newLinkPath = thisLinkPath.replace(/Raid1:/g, 'Drobo:RAID1:');
           } else if (thisLinkPath.substring(0,5) == '320GB:') {
                newLinkPath = thisLinkPath.replace(/320GB:/g, 'Drobo:RAID2:');
           var newFile = new File(newLinkPath);


      Picture 1.png