Here's a button which should take care of it. Go into to a collection and click it, and it will make a list of items which don't exist and then remove them from the collection:
Script code for reference
function OnClick(clickData)
{
var cmd = clickData.func.command;
cmd.deselect = false; // Prevent automatic deselection
cmd.ClearFiles();
var fsu = DOpus.FSUtil();
for (var e = new Enumerator(clickData.func.sourcetab.all); !e.atEnd(); e.moveNext())
{
var item = e.item();
if (fsu.Exists(item.RealPath))
{
continue; // Skip items that exist. (This also skips sub-collections.)
}
cmd.AddFile(item);
}
if (cmd.files.count)
{
cmd.RunCommand("Delete REMOVECOLLECTION");
}
}
If network paths are involved, and the servers are offline, it might run much slower as there can be a 30 second timeout before Windows decides a server isn't contactable. But it should still work in the end, and the delay should only happen once for each server (or not at all if Windows has recently cached the fact it's not available).
If needed, you could edit the code to output to the Script Log what it's going to remove, without removing anything at the end, if you want to check the logic makes sense for your collection:
function OnClick(clickData)
{
var cmd = clickData.func.command;
cmd.deselect = false; // Prevent automatic deselection
cmd.ClearFiles();
var fsu = DOpus.FSUtil();
for (var e = new Enumerator(clickData.func.sourcetab.all); !e.atEnd(); e.moveNext())
{
var item = e.item();
if (fsu.Exists(item.RealPath))
{
continue; // Skip items that exist. (This also skips sub-collections.)
}
cmd.AddFile(item);
DOpus.Output("Want to remove: " + item);
}
if (cmd.files.count)
{
// cmd.RunCommand("Delete REMOVECOLLECTION");
}
else
{
DOpus.Output("Nothing to remove.");
}
}