#7264

Mike
Member

Duh, ok I have made my first javascript, 🙁 , to solve it.
But I still would not mind if this was a “native” option.

// Move to right
var docs = new Enumerator(editor.Documents);
var current = editor.ActiveDocument;
var first = null;
var doc = null;

for(; !docs.atEnd(); docs.moveNext() ){
doc = docs.item();
if (first == null) first = doc;

if (doc == current) {
docs.moveNext();
doc = docs.item();
if (doc == null) doc = first;
break;
}
}
if (doc != null) doc.Activate();

// Move to left
var docs = new Enumerator(editor.Documents);
var current = editor.ActiveDocument;
var last = null;
var doc = null;
for(; !docs.atEnd(); docs.moveNext() ){
doc = docs.item();
if (doc == current && last != null) break;
last = doc;
}
if (last != null) last.Activate();