Copy link to clipboard
Copied
Hi,
I have problems with moving my pages to another spread by using javaScript.
What I have:

What I want:

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.pages[0].move(LocationOptions.AT_BEGINNING, app.documents.pages[0], BindingOptions.LEFT_ALIGN);
app.documents.pages[1].move(LocationOptions.AFTER, app.documents.pages[0], BindingOptions.RIGHT_ALIGN);
app.documents.pages[2].move(LocationOptions.AFTER, app.documents.pages[1], BindingOptions.LEFT_ALIGN);
app.documents.pages[3].move(LocationOptions.AFTER, app.documents.pages[2], BindingOptions.RIGHT_ALIGN);
but it puts all the pages in one spread.
Please, any hints how to solve this?
Thanks
[Question moved to the InDesign Scripting forum. -Mod.]
Copy link to clipboard
Copied
Take a look at Page Loyout Options: (looks like you have Facing Pages on)
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#PageLayoutOptions.html
Copy link to clipboard
Copied
Try this code
var myDoc = app.documents[0];
var allSpreads = myDoc.spreads;
for(var i = 1; i < allSpreads.length; i++){
app.select(allSpreads);
allSpreads.allowPageShuffle = false;
}
allSpreads[0].remove();
Best
Sunil
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more