2 Replies Latest reply on Dec 6, 2010 8:32 AM by johanwieland

    relink psd with layers or layermask in  Indesign

    johanwieland

      Hai,

       

      i wrote several scripts to relink images from one location to another.

      but when a .psd file with more then 1 layer or with layermasks is used

      and during the first linking with that PSD, with importoptions one or more layers of the .psd are deselected,

      automaticly relinking with a (java)script causes all the layers of the PSD  visible in the Indesign files

       

      I did not found any properties of the link to re-assign after the relink

       

      example of the script so far:

       

       

      var theDoc = app.activeDocument;

      var low ="72dpi";

      var high = "300dpi";

       

       

      var myImages = theDoc.allGraphics;

       

       

      for (i = myImages.length-1; i >= 0 ; i--) {

      var myImage = myImages[i].itemLink;

       

      var org_path = myImage.filePath;

       

      org_path = org_path.replace(low,high);

       

      var myNewName  = org_path;

       

      var myNewLink = new File (myNewName);

      if (myNewLink.exists) {

      myImage.relink (myNewLink);

      myImage.update();

       

      }

      }

       

       

      are there in the DOM of Indesign properties and methods to manipulate the relink according the old link,

      only changing the linkpath. Did not found it so for.

      there are "link.properties", is that the clue?