• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Relinking Images with different name

New Here ,
Nov 21, 2011 Nov 21, 2011

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

818

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 21, 2011 Nov 21, 2011

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 21, 2011 Nov 21, 2011

Copy link to clipboard

Copied

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.status == LinkStatus.LINK_MISSING)

          {

                    // Is this an FPO one?

                    if (imgs.name.match ("_FPO\."))

                    {

                              // Remove 'FPO'

                              newName = imgs.name.replace ("_FPO\.", ".");

                       //       alert (newName);

                              // Do we have a file?

                              imglist = Folder(File(imgs.filePath).path).getFiles (newName);

                              if (imglist.length == 1)

                              {

                                        // Oh yeah

                                        imgs.relink(imglist[0]);

                              }

                    }

          }

}

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 21, 2011 Nov 21, 2011

Copy link to clipboard

Copied

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..............

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 13, 2022 Sep 13, 2022

Copy link to clipboard

Copied

LATEST
doc = app.activeDocument;

imgs = doc.links;

path = doc.filePath;

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

{

// Missing?

if (imgs.status == LinkStatus.LINK_MISSING)

{

// Is this an FPO one?

if (imgs.name.match ("_NOT FINAL\."))

{

// Remove 'FPO'

newName = imgs.name.replace ("\.", ".");

// alert (newName);

// Do we have a file?

imglist = Folder(File(imgs.filePath).path).getFiles (newName);

if (imglist.length == 1)

{

// Oh yeah

imgs.relink(imglist[0]);

}

}

}

}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines