🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1083

Re: Help with syntax: Adding pages JS CS3

#1083
From: Peter Kahrel
Date: Mon, 23 Feb 2009 19:59
11 lines
1067 bytes
Tim,

Every time you add a page to the document, you change the myDoc.pages collection, and therefore, the value of myDoc.pages.length as well. To guard yourself against that, start at the back of the document and work your way to the front. This example adds a page before evry page in the document:

p = app.activeDocument.pages; 
for (i = p.length-1; i > -1; i--) 
   app.activeDocument.pages.add (LocationOptions.before, p[i]);



Peter
Technical Details
Message-ID: <59b7feca.5@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
References: <59b7feca.-1@webcrossing.la2eafNXanI>

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,820d8b9639e366ce
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Peter Kahrel" <kahrel@kahrel.plus.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Re: Help with syntax: Adding pages JS CS3
Message-ID: <59b7feca.5@webcrossing.la2eafNXanI>
Date: Mon, 23 Feb 2009 11:59:46 -0800
References: <59b7feca.-1@webcrossing.la2eafNXanI>
Lines: 13
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit