We have a rather complex Indesign plugin that I want to port to Javascript for increased maintainability. Unfortunately the SDK is pretty different from the Scripting API in many ways. One thing that has me stumped is this:
spread->GetItemsOnPage(pageIndex, &itemsOnPage);
Arranger::SortItemsBackToFront(&itemsOnPage);
... and then I can loop through the page items in the correct order. How do I do the equivalent with the Scripting API?