🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #2334

Re: [CS3 JS] Move pages from one document to another?

#2334
From: Bal�zs_Slemmer
Date: Sat, 27 Dec 2008 18:35
21 lines
1609 bytes
I know it's quite an old topic, but I'd like share, that you actually can move pages using scripting, and of course using the Page.move() function.

its syntax goes like this:
Page.move(to, reference, binding)

where 'to' stands for a LocationOption, to specify where you want to place the page relative to the reference object.
'reference' is the key part, because it can also be a page in any open document, you just need to refer to it.
'binding' defines the location of the binding spine.

And an example, to see this in action:
// Script from here
var coverDoc = app.documents.item('cover_document');
var pagesToMove = coverDoc.pages.itemByRange(0, 1);
var chapterDoc = app.documents.item('chapter_document');
pagesToMove.move(LocationOptions.BEFORE, chapterDoc.pages.item(0));
// Script until here

You may also use duplicate() the same way, if you want to keep the original pages. (however, it doesn't have the 'binding' parameter)

I hope it can help you!
Bali
Technical Details
Message-ID: <59b742c7.5@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing
References: <59b742c7.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,497db990f6de49b1
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Bal�zs_Slemmer@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: [CS3 JS]  Move pages from one document to another?
Message-ID: <59b742c7.5@webcrossing.la2eafNXanI>
Date: Sat, 27 Dec 2008 10:35:50 -0800
References: <59b742c7.-1@webcrossing.la2eafNXanI>
Lines: 26
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit