-
1. Re: Cant able to relink
DaveSofTypefi Aug 9, 2013 4:46 AM (in response to indegn5)Something's missing. You're trying to relink to a folder. You have to relink to a file.
Dave
-
2. Re: Cant able to relink
indegn5 Aug 9, 2013 6:18 AM (in response to DaveSofTypefi)Hi Dave,
After adding a Folder, now also, it is not relinking.... please advice and help...
var aDoc = app.activeDocument.links;
myS = Folder((app.activeDocument.filePath).parent + "/Links/"); //the folder contains links....
for(var n = 0; n < aDoc.length; n++) {
//var Link = aDoc.links[n];
if (aDoc[n].status == LinkStatus.linkMissing) {
aDoc[n].relink(File(myS));
alert(aDoc[n].name);
}}
-
3. Re: Cant able to relink
rajnikids Aug 9, 2013 6:46 AM (in response to indegn5)try this......
var myFolder = Folder(app.activeDocument.filePath.parent+"/XXXX/"); // set you destination
var new_path = myFolder+ '/'
imgs = app.activeDocument.allGraphics
for (i = 0; i < imgs.length; i++)
{
img = imgs[i].itemLink
myFile = File (new_path + img.name);
if (myFile.exists) {
img.relink (File (new_path + img.name))
img.update()
//alert (img.filePath);
}
}
-
4. Re: Cant able to relink
Dave Saunders Aug 9, 2013 6:49 AM (in response to rajnikids)new_path has // at the end -- why?
Dave
-
5. Re: Cant able to relink
rajnikids Aug 9, 2013 8:01 AM (in response to Dave Saunders)Im Sorry Dave,
I used this for PC, and just copied and pasted for mac.....
not needed + '/'
Many thanks


