Huzah!
That seems to work - just 2 small things.
- It went through links one by one - confirming each one - anyway it can do it without confirming each one?
- And - is it possible just on the selected images in the links panel?
I’m not getting any dialogs, but this should prevent them:
var f = Folder.selectDialog("Select the folder");
var lks = app.documents[0].links;
var n, nn, na;
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.NEVER_INTERACT;
for (var i = 0; i < lks.length; i++){
if (lks[i].status == LinkStatus.LINK_EMBEDDED) {
n = lks[i].name;
na = n.split( "." )
nn = lks[i].name.replace(/_\d+(\.[^\.]+)$/, "."+ na[na.length-1])
lks[i].unembed(f);
File(lks[i].filePath).rename(nn);
lks[i].relink(File(f+"/"+nn))
}
};
app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;
I don’t think there is a way to get a Link panel selection. You could do it via a range of pages if that helps.