0 Replies Latest reply on Jan 30, 2009 1:15 AM by Loic.Aigon

    [JS CS3] Function relink working but nof fully functional

    Loic.Aigon Adobe Community Professional
      Hi,
      I wrote this function to update all my links as path were modified.
      It runs well except that when I launch it, it let a few links not updated.
      I need to relaunch and relaunch the script as long as necessary to get all links updated.
      Is this a know issue ?

      I run it as a loop call for any of my links
      link is links[i]
      name is the name of the broken link (ie : lostlink.tif)
      newlink is the link to the new file (ie. /d/.../newlink.tif)
      So for all links, it looks for the link status.
      If it's not normal, it will check for the name of the link and look if it contains the name requested. In this case, it will relink the link to a new direction and update it.

      function relinks(link, name, newlink)
      {
      if(link.name.indexOf(name)>=0 && link.name.indexOf("/m/")==-1)
      {
      link.relink(File(newlink));
      link.update();
      link.parent.fit(FitOptions.PROPORTIONALLY)
      link.parent.fit(FitOptions.CENTER_CONTENT);
      }
      }

      thanks for advice
      Loic