Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Spreads managing in JavaScript

New Here ,
Jan 14, 2019 Jan 14, 2019

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.]

TOPICS
Scripting
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 14, 2019 Jan 14, 2019

Take a look at Page Loyout Options: (looks like you have Facing Pages on)

https://www.indesignjs.de/extendscriptAPI/indesign-latest/#PageLayoutOptions.html

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Jan 15, 2019 Jan 15, 2019
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines