3 Replies Latest reply on Nov 21, 2011 11:48 PM by Dannywk360

    Relinking Images with different name

    Dannywk360

      Hi

       

      As a pre-press provider working with a large catalogue company who produce thier own files, we have problems with the Indesign files that they supply to us, in that the images linked in the document all have _FPO at the end of the filname. However the hires version, which we download does not, so the filenames do not match and the link will not automatically update. For example filename 12345_FPO is placed in the document, but the hires image is called 12345.tif. There can be up to 80 links in the document which all have to be swapped manually.

       

      Does anyone know of a script or plug in which will exclude the last 'so many' characters of a filename when re-linking?

       

      Any help would be greatly appreciated!

       

      Danny

        • 1. Re: Relinking Images with different name
          [Jongware] Most Valuable Participant

          You can adjust this last week's script that examines image names and relinks them after some manipulation:

           

          need to relink missing links to files with extensions

           

          -- all you have to do is strip off the "_FPO", test if this file actually exists (I'd recommend that extra step), and if so relink.

          • 2. Re: Relinking Images with different name
            [Jongware] Most Valuable Participant

            Here you go. Worked just fine & dandy with the one test file I created.

             

            doc = app.activeDocument;
            imgs = doc.links;
            path = doc.filePath;
            
            for (i=0; i<imgs.length; i++)
            {
                      // Missing?
                      if (imgs[i].status == LinkStatus.LINK_MISSING)
                      {
                                // Is this an FPO one?
                                if (imgs[i].name.match ("_FPO\."))
                                {
                                          // Remove 'FPO'
                                          newName = imgs[i].name.replace ("_FPO\.", ".");
                                   //       alert (newName);
                                          // Do we have a file?
                                          imglist = Folder(File(imgs[i].filePath).path).getFiles (newName);
                                          if (imglist.length == 1)
                                          {
                                                    // Oh yeah
                                                    imgs[i].relink(imglist[0]);
                                          }
                                }
                      }
            }
            

             

            Message was edited by: [Jongware] No need for a continuous alert popping up :)

            • 3. Re: Relinking Images with different name
              Dannywk360 Level 1

              Fantastic!

               

              Thank you i will test it out later......... Thanks ever so much for

              looking into this for me, i will let you know how i get on..............