After digging around in the scripting section of this forum, I managed to find a snippet of a script which replaces image names in the text with the actual image. Very useful stuff.
// reset the Find/Change dialog app.findGrepPreferences = app.changeGrepPreferences = null; // formulate a grep search string app.findGrepPreferences.findWhat = '@.+?@'; // find all occurrence of image names between @, last one first f = app.activeDocument.findGrep (true); for (i = 0; i < f.length; i++) { // construct file name name = f[i].contents.replace (/@/g, ''); // place the pdf and REPLACE the destination with the folder of links f[i].insertionPoints[0].place ('Insert image folder here' + name)); } // delete all @??@ codes app.activeDocument.changeGrep()↧