Skip to main content
November 28, 2012
Answered

Insert page on Spread

  • November 28, 2012
  • 1 reply
  • 1153 views

I want to insert a page after page 2 on spread 2

I set Document property

with(myDocument.documentPreferences)

{

    facingPages=false;

    allowPageShuffle=false;

    }

and add new page after page 2 as :

var page=myDocument.pages.item(1);

var pages= myDocument.pages.add(1634104421,page); //1634104421 for AFTER

But page is insert on new spread .

How insert page on same spread ?

Thanks

This topic has been closed for replies.
Correct answer Jongware

You add a page after the next one because you are targeting pages. To add to a spread, you must target the spread itself. Just as in the interface, before doing so you need to set "Allow Spread to Shuffle" to false:

myDocument.spreads.item(1).allowPageShuffle = false;

var page=myDocument.spreads.item(1).pages.item(1);

var pages= myDocument.pages.add(LocationOptions.AFTER,page);

1 reply

Jongware
Community Expert
JongwareCommunity ExpertCorrect answer
Community Expert
November 28, 2012

You add a page after the next one because you are targeting pages. To add to a spread, you must target the spread itself. Just as in the interface, before doing so you need to set "Allow Spread to Shuffle" to false:

myDocument.spreads.item(1).allowPageShuffle = false;

var page=myDocument.spreads.item(1).pages.item(1);

var pages= myDocument.pages.add(LocationOptions.AFTER,page);

November 29, 2012

Hi  Jongware

thanks for reply

If I do it manualy in indesign application

in page panel first i set "Allow Document pages to Shuffle"

Then  in menu   Layout --> Pages ---> Insert page -->pages=1,After page 2, A-Master.

It insert page on same spread not create a new spread.

So in script i set

with(myDocument.documentPreferences)

{

    facingPages=false;

    allowPageShuffle=false;

}

Then i want to know where (in which condition)

myDocument.documentPreference.allowPageShuffle=false

use.

Thanks

Jongware
Community Expert
Community Expert
November 29, 2012

"Allow document pages to shuffle" is an interface option, so you can drag pages to attach to the edge of a spread. If this option is switched on, you can only add new pages in between a spread. See http://help.adobe.com/en_US/indesign/cs/using/WSa285fff53dea4f8617383751001ea8cb3f-7122a.html#WSa285fff53dea4f8617383751001ea8cb3f-7112a

Since a script does not work with "drag" and can target a spread (or page) immediately, you don't need to change the document option.

(.. After trying it out for myself) .. and, so it appears, you also do not need to set

myDocument.spreads.item(1).allowPageShuffle = false;

probably for the same reason.