2 Replies Latest reply on Mar 31, 2008 5:33 AM by hm_arul

    how to skip missing image when script relink images

    hm_arul Level 1
      Hi scripter,

      here i am updating image links from old path to new path, the images are relinked well.

      but when there is no linked image in the image folder the script stops, now i want to skip the missing image and relink the next one.

      here is my code, any one please advice me how to skip missing images?

      thanks in advance

      try{

      var myFolder = Folder.selectDialog("Select Folder for Images");

      //alert(myFolder);

      var new_path = myFolder+ '/'

      imgs = app.activeDocument.allGraphics

      for (i = 0; i < imgs.length; i++)

      {

      img = imgs[i].itemLink

      img.relink (File (new_path + img.name))

      img.update()

      }

      }

      catch(err)

      {

      alert("Image " + img.name + " is missing in your folder");

      }

      regards
      a r u l