Skip to main content
Participant
November 6, 2012
Question

CS6 - Using JS to move pages to a new pasteboard?

  • November 6, 2012
  • 1 reply
  • 1069 views

I have a bunch of documents that have four 8.5x11 pages set up as spreads on a single pasteboard. I need to script moving the last two pages onto a new pasteboard. Hope that makes sense.

Basically, from this:

PASTEBOARD 1

Pages 1,2,3,4

To this:

PASTEBOARD 1

Pages 1,2

PASTEBOARD 2

Pages 3,4

Can anyone help point me in the right direction? Thanks!

This topic has been closed for replies.

1 reply

Jump_Over
Legend
November 7, 2012

Hi,

use this:

myDoc = app.activeDocument;

mySpread = myDoc.spreads.add();

myDoc.pages.itemByRange(-2,-3).move(LocationOptions.AT_BEGINNING,myDoc.spreads[-1]);

myDoc.pages[-1].remove()

hope...

Jongware
Community Expert
Community Expert
November 7, 2012

Jumpy, why are you removing a page in the last line?

Jump_Over
Legend
November 7, 2012

Hi,

Is .spreads.add() equal to adding a new page also?