Relink an image to a file that does not exist
Is there any way to relink a placed image to a file that does not exist yet? I have an INDD file with a bunch of other INDD files placed as links. I want to replace each of those INDD links with a PDF of the exact same name, but a .pdf extension. This script works when the PDF version of the file already exists:
var links = app.activeDocument.links,
linksLength = links.length;
for (var i = linksLength-1; i >= 0 ; i--) {
var oldLink = links[i];
if(oldLink.linkType == "InDesign Format Name") {
var newLink = new File(oldLink.filePath.replace(".indd",".pdf"));
oldLink.relink(newLink);
}
}
But in my workflow, the PDFs are not yet created so running this script fails because the newLink does not yet exist. I want them to show as missing for now.
Maybe, instead of a "relink", what I need is just some way to change the name of the link that InDesign is looking for without first confirming that it exists.
Any ideas? Thanks!
