Skip to main content
Inspiring
March 4, 2011
Question

Relink images

  • March 4, 2011
  • 1 reply
  • 460 views

Hi,

There are several images placed in my documents which name have been changed. Only an extension .eps added in all images name.

Anyone know how to relink images with new name.

Thanks,

Mon

This topic has been closed for replies.

1 reply

Ten A
Community Expert
Community Expert
March 7, 2011

I don't know how to Relink images. But I know how to get fullpath of placing images, and how to place Images in rectangles.

We can collect Images filepath,

app.activeDocument.rectangles[0].epss[0].properties.itemLink.filePath

If you only change filenames extension, you can replace the EPS images, and other properties can keep before replace Images.

for (var i=0;i<app.activeDocument.rectangles.length;i++) {
    if (app.activeDocument.rectangles.epss.length>0){
        var n = app.activeDocument.rectangles.epss[0].properties.itemLink.filePath;
        var f = File (n);
        app.activeDocument.rectangles.place(f);
        }
    }

Though it only has to be useful...