Relink multiple images in one go

Explorer ,
Mar 05, 2020

Copy link to clipboard

Copied

Hi,

 

Is there a way I can relink a select number of images on a document in one go rather than having to relink one by one?

 

For example, in the image below, the graphic is duplicated 112 times. Let's say I want to replace 50 of the links with a graphic that has a different price on it. At the moment, I have to select the graphics I want to change and then go through the relink procedure 50 times, which is very time-consuming (and incredibly frustrating!)

 

Is there a way to do this within InDesign? Is there a script available? I'm also happy to use Illustrator if there's a way it can be done there, although I haven't found a solution for that either.

 

Thanks for any help you guys can give.

 

Screenshot 2020-03-05 at 09.48.22.png

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

This assumes that you have the frames selected with the regular black arrow tool, and that there is only one linked image within that frame:

 

 

var fileToRelink = File.openDialog("Choose the file to relink to");
var selects = app.selection;

for (var i = 0; i < selects.length; i++) {
    selects[i].graphics[0].itemLink.relink(fileToRelink);
}

 

TOPICS
How to, Import and export, Scripting

Views

1.3K

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

Relink multiple images in one go

Explorer ,
Mar 05, 2020

Copy link to clipboard

Copied

Hi,

 

Is there a way I can relink a select number of images on a document in one go rather than having to relink one by one?

 

For example, in the image below, the graphic is duplicated 112 times. Let's say I want to replace 50 of the links with a graphic that has a different price on it. At the moment, I have to select the graphics I want to change and then go through the relink procedure 50 times, which is very time-consuming (and incredibly frustrating!)

 

Is there a way to do this within InDesign? Is there a script available? I'm also happy to use Illustrator if there's a way it can be done there, although I haven't found a solution for that either.

 

Thanks for any help you guys can give.

 

Screenshot 2020-03-05 at 09.48.22.png

Adobe Community Professional
Correct answer by brianp311 | Adobe Community Professional

This assumes that you have the frames selected with the regular black arrow tool, and that there is only one linked image within that frame:

 

 

var fileToRelink = File.openDialog("Choose the file to relink to");
var selects = app.selection;

for (var i = 0; i < selects.length; i++) {
    selects[i].graphics[0].itemLink.relink(fileToRelink);
}

 

TOPICS
How to, Import and export, Scripting

Views

1.3K

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
Mar 05, 2020 1
Adobe Community Professional ,
Mar 05, 2020

Copy link to clipboard

Copied

Hi,

can you confirm the version of the software and operating system you are using?

 

Here what I would do:

  • duplicate your file
  • in one version of the indd file,
    • I would delete half the images
    • in the Link panel, update the link to the new image
  • In the other version of the indd file, copy the other half of the image
  • paste the second batch into the first version
  • you should get the mix of images on the same page

 

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
Reply
Loading...
Mar 05, 2020 0
Explorer ,
Mar 05, 2020

Copy link to clipboard

Copied

Ah, yes sorry, I should have mentioned. Mac OS Catalina, InDesign 15.0.2.

 

That sounds like a viable workaround. I'll use that method if a quicker way doesn't show up!

 

Thanks Eric, much appreciated.

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
Reply
Loading...
Mar 05, 2020 0
Adobe Community Professional ,
Mar 05, 2020

Copy link to clipboard

Copied

Please update this thread if you find a better solution

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
Reply
Loading...
Mar 05, 2020 1
Adobe Community Professional ,
Mar 05, 2020

Copy link to clipboard

Copied

This assumes that you have the frames selected with the regular black arrow tool, and that there is only one linked image within that frame:

 

 

var fileToRelink = File.openDialog("Choose the file to relink to");
var selects = app.selection;

for (var i = 0; i < selects.length; i++) {
    selects[i].graphics[0].itemLink.relink(fileToRelink);
}

 

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
Reply
Loading...
Mar 05, 2020 0
Explorer ,
Mar 05, 2020

Copy link to clipboard

Copied

How do I use this within the InDesign document?

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
Reply
Loading...
Mar 05, 2020 0
Adobe Community Professional ,
Mar 06, 2020

Copy link to clipboard

Copied

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-po...

 

Once the script is installed, select the frames of the images you want to replace with the selection tool (black arrow), then execute the script. You will be prompted to select the image file you want to relink. The rest is magic. This is a .jsx script (ExtendScript).

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
Reply
Loading...
Mar 06, 2020 0
Explorer ,
Mar 06, 2020

Copy link to clipboard

Copied

Ok, I see now. I've followed the instructions and used TextEdit to save the script, but it doesn't seem to work. I guess maybe I'm doing something wrong?

 

Screenshot 2020-03-06 at 08.32.33.pngScreenshot 2020-03-06 at 08.31.06.png

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
Reply
Loading...
Mar 06, 2020 0
Adobe Community Professional ,
Mar 06, 2020

Copy link to clipboard

Copied

Hi Jon,

did you save the script with TextEdit app as Text only?

 

If yes, we have a serious problem with Catalina and ExtendScript scripts in the User folder of the Scripts folder:

In previous versions of OS X a *.jsx file was considered to be owned by the ExtendScript Toolkit app ( ESTK ), but now with OSX 10.15 the ESTK cannot be installed anymore, it is 32-Bit software, so my assumption is that a jsx suffix will not be recognized anymore as what it is, a script that could be run with InDesign ( or other CC apps like Illustrator, PhotoShop etc.pp. ). Usually a orderly saved ExtendScript script that lies in the User folder of the Scripts panel should run with InDesign. Maybe that changed with Catalina? That would be a serious bug with InDesign.

 

FWIW: I cannot test this because I'm not on OS X 10.15 Catalina.

Maybe someone else could test this?

 

A workaround could be to move the script file to InDesign's Script folder of the Application or to the new Community script folder in InDesign's application folder.

 

Regards,
Uwe Laubender

( ACP )

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
Reply
Loading...
Mar 06, 2020 0
Explorer ,
Mar 06, 2020

Copy link to clipboard

Copied

I thought I had saved it as text only but obviously not! I just tried saving the script again and it worked! I must have done something different as the original file that didn't work has 'TXT' in the icon and the new one doesn't.

 

Thanks, everyone for you help. It works a treat and will save me a lot of time in the future!

 

Screenshot 2020-03-06 at 12.35.54.pngScreenshot 2020-03-06 at 12.36.08.png

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
Reply
Loading...
Mar 06, 2020 1
Adobe Community Professional ,
Mar 06, 2020

Copy link to clipboard

Copied

Sometimes by default, TextEdit can be set to do the text in RTF format, which would mess up the .jsx coding. To ensure you have it correct in the future, in TextEdit you'd select the text and go to Format > Make Plain Text just to be sure. 

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
Reply
Loading...
Mar 06, 2020 1
Explorer ,
Mar 06, 2020

Copy link to clipboard

Copied

I did actually have the format set to Plain Text. I worked out that in the Save dialog box, I should have 'un-ticked' the option to use .txt if no extension is provided, even though I did put .jsx at the end of the filename when saving.

 

Screenshot 2020-03-06 at 16.33.06.png

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
Reply
Loading...
Mar 06, 2020 0
Edefaria LATEST
New Here ,
Dec 03, 2020

Copy link to clipboard

Copied

You just gave us a show. Thanks

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
Reply
Loading...
Dec 03, 2020 0