4 Replies Latest reply on Feb 16, 2010 12:11 PM by johanwieland

    Relinking to other filepath in Indesing CS4

    johanwieland

      I have a javascript in CS3 that remaps the linkfile-path from a windows fileserver to an OSX file server.

       

      but that script will not work in CS4, link.filePath return an empty string if the image is unavailable in CS4

       

      <  snippet>

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

      var myImage = myImages[i].itemLink

      alert(myImage.filePath);

      }

       

      < end snippet >

       

      does anyone known a sollution how to read the filePath

       

       

       

        • 1. Re: Relinking to other filepath in Indesing CS4
          ramkumar.vp Level 3

          Hi,


          Use the below code to execute the same:


          var myImages = app.activeDocument.links;
          for(i = myImages.length-1; i >= 0 ; i--)
          {
              var myImage = myImages[i];
              myImage.show();
              alert(myImage.filePath);
          }


          Regards,

          Ramkumar .P

          • 2. Re: Relinking to other filepath in Indesing CS4
            johanwieland Level 1

            Hello Ramkumar

             

            thanks for your input,

            but that won't solve the problem,

             

            in the case of missing images, link.filepath returns an empty string in CS4, while CS3 is showing the filepath

             

            I need that filepath partially to remap to a new filepath (from windows environment to osx environment, but that trick is under control)

             

            so if anyone knows how to map the missing old filepath in CS4 to a string?

             

            thanks in advance,

             

            Johan

            • 3. Re: Relinking to other filepath in Indesing CS4
              Kasyan Servetsky Level 5

              Similar issues were discussed a few times on this and ID forums --  last time in this tread.

              I suggest the following options:

               

              However, you say that link.filePath returns an empty string for missing links. I remember that one guy on this forum had a problem like this —  the reason was that the files were converted from Quark by some plug-in — it seems Q2ID its name — and were corrupted: if memory serves me right, link.filePath was empty string, but link.name contained what should have been link.filePath.

              I solved it by modifying the script attached

               

              Kasyan

              1 person found this helpful
              • 4. Re: Relinking to other filepath in Indesing CS4
                johanwieland Level 1

                Hello Kasyan,

                 

                thanks for your input.

                and yes indeed, I found that the original file was converted from CS3 to CS4, and it that case, the link.filePath returns empty.

                i tried it with a new Indesign CS4 document, trashed the imported graphic, and link.filePath returned the filepath correctly

                 

                that is in contradiction with CS3, were the link.filePath always returned old filepath.

                (and give me  problems when both CS3 and CS4 files are running through the automatic workflow with Enfocus PowerSwitch)

                 

                 

                thanks,

                 

                Johan Wieland