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

Batch relinking to different file type - InDesign CS4

New Here ,
Feb 18, 2010 Feb 18, 2010

Can anyone help me generate a script which will relink all images of a particular file type to a file of the same name but of a different format?  For example, every linked Illustrator file should be relinked to a PDF or EPS of the same file name (but appropriate file extension of course).

Colin

TOPICS
Scripting
1.5K
Translate
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

correct answers 1 Correct answer

Engaged , Feb 18, 2010 Feb 18, 2010

Hi Colin,

It is already discussed, but here below code for you

var doc = app.activeDocument;

var lk = doc.links;

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

{

lkname =lk.name;

if(lkname.indexOf(".ai")>=0)

{

var lkname0 = lkname.split(".ai")[0];

lkfolder = File(lk.filePath).parent;

myFile = File(lkfolder+"/"+lkname0+".pdf");

if (myFile.exists) {

lk.relink(File(lkfolder+"/"+lkname0+".pdf"));

}}

}

or you can use Kasyan relink image script

http://kasyan.ho.com.ua/relink.html

Shonky

Translate
Engaged ,
Feb 18, 2010 Feb 18, 2010

Hi Colin,

It is already discussed, but here below code for you

var doc = app.activeDocument;

var lk = doc.links;

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

{

lkname =lk.name;

if(lkname.indexOf(".ai")>=0)

{

var lkname0 = lkname.split(".ai")[0];

lkfolder = File(lk.filePath).parent;

myFile = File(lkfolder+"/"+lkname0+".pdf");

if (myFile.exists) {

lk.relink(File(lkfolder+"/"+lkname0+".pdf"));

}}

}

or you can use Kasyan relink image script

http://kasyan.ho.com.ua/relink.html

Shonky

Translate
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 ,
Feb 18, 2010 Feb 18, 2010
LATEST

Thank you so much.  That works perfectly.  Not sure why I couldn't find any reference to a solution, spent the best part of this morning searching.  Must not have been looking under the right terms.

Thanks again.

Translate
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