Question
How to ensure the key object remains stationary (at the first of sel)?
Ensure the key object is always the first element in “sel”.
Other objects should always be positioned to the right.
I intend to set sel[j].geometricBounds so that the keyObject remains stationary while the others are arranged to its right.
The code below doesn't seem to be working.

var sel = app.documents[0].selection;
var key = app.selectionKeyObject;
var sb = key.visibleBounds;
sel.sort(function (a, b) {
var a = key.visibleBounds;
var b = b.visibleBounds;
if (a[1] > b[1]) {
return 1;
} else if (a[1] < b[1]) {
return -1;
}
});
