I'd like to re-arrange my pages in InDesign using JavaScript.
At this moment im coding it page after page for debugging. Later i'll put that into loop of course. My code is something like that:
app.documents[i].pages[0].move(LocationOptions.AT_BEGINNING, app.documents[i].pages[0], BindingOptions.LEFT_ALIGN);
app.documents[i].pages[1].move(LocationOptions.AFTER, app.documents[i].pages[0], BindingOptions.RIGHT_ALIGN);
app.documents[i].pages[2].move(LocationOptions.AFTER, app.documents[i].pages[1], BindingOptions.LEFT_ALIGN);
app.documents[i].pages[3].move(LocationOptions.AFTER, app.documents[i].pages[2], BindingOptions.RIGHT_ALIGN);
...
but it puts all the pages in one spread.
Please, any hints how to solve this?
Thanks