7 Replies Latest reply on Jun 5, 2013 11:07 AM by Colourjam

# relink images from different locations

Hi Forum,

I have a big tricky thing to do with myself...

i have placed an image inside indesign document from desktop of my system(smb://172.11.11.0/). Saved and closed. and only the indesign file is sent to other person. (the other person  has the same link in his system).

Can i be able  to link the image placed inside the document automatically through script,

searching the missed link name, which is also available in other person system (smb://174.12.22.0/).

subfolder structures matches in both the system. only the IP address of machines changes...

eg. placed link location of my system (mac) is:

smb://172.11.11.0/user/Comics/Images/abc.tif

placed link location in other system (mac):

smb://174.12.22.0/user/Comics/Images/abc.tif

Only the IP address of the system is changing all other subfolders following IP address remains same...

@Chand.

• ###### 1. Re: relink images from different locations

Hi Forum,

I have also tried with this bit in PC system...

var myFolder = new File("~E:\script_29th_March\in testing");

//the location mentioned here is other system image folder location..

//previous  locations of the placed image is

var myFolder = new File("C:\Documents and Settings\Chand\Desktop\script_29th_March\in testing")

var new_path = myFolder+ '/'

imgs = app.activeDocument.allGraphics

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

{

myFile = File (new_path + img.name);

if (myFile.exists) {

img.update()

}

}

so the subfolder \script_29th_March\in testing matches in both the system.

• ###### 2. Re: relink images from different locations

Try this:

var linksArr = document.links.everyItem().getElements();
for (var i = 0; i < linksArr.length; i++) {
}
throw new Error("Link " + link + " is out of date.");
}
}
}
}


• ###### 3. Re: relink images from different locations

thanks dln385,

I'll give a try in my office mac system tomorrow and let you know..

another question dln385,

when I give var myFolder = Folder.selectDialog("C:\Documents and Settings\Chand\Desktop.

var myFolder = new File("C:\Documents and Settings\Chand\Desktop\script_29th_March\in testing")

I dont know Y, it is not relinking...

• ###### 4. Re: relink images from different locations

Log out new_path + img.name.

$.writeln(new_path + img.name);  Check to see if it logs something different depending on whether or not you use the dialog. • ###### 5. Re: relink images from different locations • ###### 6. Re: relink images from different locations thanks to a great Kasayn. for given a poetic script continued to a page, I really stunned at it.. thanks G..... I would be greatfull to you, if I can get the solution for this too.. where this script ask for folder/subfolders to select the missed file.. WHen i tried using to locate the link file directly, it is not working.. As, dln385, said i also used. $.writeln(new_path + img.name);, but still the problem persists.

var myFolder = new File("C:\Documents and Settings\Chand\Desktop\

(\\ instead of Folder.selectDialog, i'm trying to directly locate the link location)

var new_path = myFolder+ '/'

imgs = app.activeDocument.allGraphics

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

{

myFile = File (new_path + img.name);

if (myFile.exists) {

img.update()

}

}

Many thanks to Kasyan & dln385

• ###### 7. Re: relink images from different locations

Slightly diffent question here. Does anyone know of a script where from the listed images in links on Indesign, I can resize to 300 ppi(effective),  then re-name images so changing the prefix, then resave them all to a new location specific for the hi res images. Then finally indesign relinks to new named files. That would be a great script if there was one.

Also is it possible to be selective on  images, so certain directories (ie Stock images) can be left as is. Ie Not effected by script.

I have looked around and havent found anything so specific on Adobe, I am running Cs6 on PC. Which script format would be best?

I hope you can help