Question
Indd - JS: Searching an image in subfolders and relinking
Hi,
Can any one help me....
In an Indesign Document I want to relink all the images to a new path.
Please see the below script, it search for the images in a specified path only. But i want to search the images in a particular directory along with its sub-folder too.
var myFolder = Folder.selectDialog("Select Folder for Images");
var new_path = myFolder+ '/'
imgs = app.activeDocument.allGraphics
for (i = 0; i < imgs.length; i++)
{
img = imgs.itemLink
myFile = File (new_path + img.name);
if (myFile.exists) {
img.relink (File (new_path + img.name))
img.update()
}
}
Thanks in advance,
Bharathi Raja G.
Can any one help me....
In an Indesign Document I want to relink all the images to a new path.
Please see the below script, it search for the images in a specified path only. But i want to search the images in a particular directory along with its sub-folder too.
var myFolder = Folder.selectDialog("Select Folder for Images");
var new_path = myFolder+ '/'
imgs = app.activeDocument.allGraphics
for (i = 0; i < imgs.length; i++)
{
img = imgs.itemLink
myFile = File (new_path + img.name);
if (myFile.exists) {
img.relink (File (new_path + img.name))
img.update()
}
}
Thanks in advance,
Bharathi Raja G.