While writing CycleListers I stumbled upon a few things worth mentioning:
Listers from the DOpus.listers
collection can be referenced by their collection index as well as their Windows handle HWND
which is their default property.
for (var i = 0; i < DOpus.listers.count; i++) {
DOpus.Output(DOpus.listers(i));
}
I don't think this info is in the docs.
The only way to bring a lister to the front seems to be
cmd.SetSourceTab(DOpus.listers(listerToActivate).activetab);
cmd.RunCommand('Set LISTERCMD=tofront');
I never got this or any variation working:
DOpus.listers.ToFront(DOpus.listers(listerToActivate));
Referencing a lister via DOpus.listers(lister)
will result in an out-of-range JScript error if the lister does not exist.
We can check with a function like
function ListerExists(listerID) {
for (var i = 0; i < DOpus.listers.count; i++) {
if (String(DOpus.listers(i)) == String(listerID)) return true;
}
return false;
}
but being able to check with
if (DOpus.listers(lister)) ...
would be nicer.