Hi again, I have written something that should work for you. Could you please try it? To use, make a selection of one of your placed images (the cover) and run the script. It will ask for you to select the new cover image file and (hopefully!) update each other old cover in the document.
var items = app.activeDocument.selection;
if (items.length > 0) {
relinkPlacedItem(items[0]);
}
function relinkPlacedItem(placedItem, allInstances) {
try {
if (allInstances === undefined) allInstances = true;
if (placedItem === undefined) throw 'No placedItem supplied to relinkPlacedItem.';
if (placedItem.typename === 'GroupItem') {
placedItem = placedItem.placedItems;
if (placedItem.length === 0) throw 'No placedItem supplied to relinkPlacedItem.';
placedItem = placedItem[0];
}
if (placedItem.file === undefined) throw 'No file linked to item.';
// ask user for a new file
var newFile = File.openDialog('Relink to:');
if (newFile !== null) {
var placedItems = app.activeDocument.placedItems;
if (allInstances) {
var matchedPlacedItems = [];
for (var i = 0; i < placedItems.length; i++) {
if (placedItems[i].file.toString() === placedItem.file.toString()) {
// found an instance of the placedItem
matchedPlacedItems.push(placedItems[i]);
}
}
// relink the placedItems
for (var i = 0; i < matchedPlacedItems.length; i++) {
matchedPlacedItems[i].relink(newFile);
}
} else {
// relink just the selected placedItem
placedItem.relink(newFile);
}
}
} catch (error) { alert(error) }
}
Regards,
Mark