It can be done via scripting, but why for? Just rename the folder Links1
to Links
and reopen the document. Then, If you need, rename the folder Links
back to Link1
and rename the folder Links2
to Links
. And reopen your doc again. And so on.
The script does just the same thing:
Initial folders: Links
, Links2
, Links3
, Links4
Run script 1: Links
<-- former Links2, Links1
<-- former Links, Links3
, Links4
Run script 2: Links
<-- former Links3, Links1
, Llinks2
<-- former Links, Links4
Run script 3: Links
<-- former Links4, Links1
, Links2
, Links3
<-- former Links
Run script 4: Links
<-- former Links1, Links2
, Links3
, Links4
<-- former Links
Etc
var doc = app.activeDocument;
var base_path = doc.filePath;
var base_name = "Links";
var base_folder = Folder(base_path + "/" + base_name);
var names = ["Links1", "Links2", "Links3", "Links4"];
// circular check and renamimg folders
var i = 0
while (true) {
var prev_folder = Folder(base_path + "/" + names[i]);
if (!prev_folder.exists) {
base_folder.rename(names[i]);
if (i < names.length-1) i++; else i = 0;
var next_name = names[i];
var next_folder = Folder(base_path + "/" + next_name);
next_folder.rename(base_name);
break;
}
i++;
if (i > names.length-1) break; // just in case
}
// update all links
for (var i=0; i<doc.links.length; i++) {
if (doc.links[i].status == LinkStatus.linkOutOfDate) doc.links[i].update();
}