Reputation: 11
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
Upvotes: 0
Views: 427
Reputation: 11
Guess i found the answer:
app.documents[i].pages[k1].move(LocationOptions.AT_BEGINNING, app.documents[i].spreads.item(n).pages.item(0), BindingOptions.LEFT_ALIGN);
app.documents[i].pages[k2].move(LocationOptions.AFTER, app.documents[i].spreads.item(n).pages.item(0), BindingOptions.RIGHT_ALIGN);
Which translates to: "Move page [k1] at the beginning of page (0) on spread (n) and align it left." Then: "Move page [k2] after page (0) on spread (n) and align it right."
Thank you Me. No problem brother. Anytime.
Upvotes: 1