distribute
document.distribute() doesn't allow aligning of pages.
doc.distribute (doc.pages.everyItem(), DistributeOptions.HORIZONTAL_SPACE, true, 0)
RESULT:
Error: Invalid value of parameter "alignDistributeItems" of method "distribute". Expected array of PageItems, but received (Page,Page,Page).
Expected: I can align pages in the UI via Align panel so I expect I can do the same in scripting.
![](https://secure.gravatar.com/avatar/2ba9e94a493f6c48b59b61876d750c71?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
-
jon@StewartDesign.studio commented
A cluggy workaround is to use page.move() but that involves shuffling pages in front/back of each other to get them 0 aligned in the correct order:
// move all pages next to each other on same spread
pgSpine.move(LocationOptions.AT_END,pgBack.parent);
pgFront.move(LocationOptions.AT_END,pgBack.parent);