0 Replies Latest reply on Oct 29, 2010 11:41 AM by GbHerff

    Replace missing links

    GbHerff Level 1

      I am having trouble with a script to replace missing links with a default "missing graphic." We often have images that are not submitted by the customer. Our new server software does not allow OPI Pdfs to go through with missing images. I am "trying" to write a script to scan a document for links that are missing and relink them to a "missing image" graphic. I keep getting a javascript error that the link is missing. The path is correct. I pasted it directly from the address bar of windows explorer. I am currently testing with IDCS3 on XP, but will need it to work for all versions.(Adobe loves to change syntax in javascript from one version to the next). Thanks in advance. This forum has helped me so many times.

       

      var myDoc = app.activeDocument;
      var fpath = myDoc.filePath + "";
      checkLinkNormal();
      function checkLinkNormal() {
      for(var myCounter = 0; myCounter < myDoc.links.length; myCounter++) {

      var myLink = myDoc.links[myCounter];
      if(myLink.status == LinkStatus.linkMissing) {
                    if(File.fs == "Macintosh"){
                      var MisImage=(File("volume:MissImage.tif"));
          myLink.relink (MisImage)
          myLink.update
         }
           else{
          var MisImage=(File("\\server\share\MissImage.tif"));
          myLink.relink (MisImage)
          myLink.update
                  }
        }
      }
      }