Article View: adobe.scripting.indesign
Article #2140[JS CS3] Page side when adding pages
From: Rick_Quatro
Date: Mon, 05 Jan 2009 14:01
Date: Mon, 05 Jan 2009 14:01
27 lines
1597 bytes
1597 bytes
Hello all,
I am using a script to remove oversets by adding pages with linked text frames to the end of the document. When I am done removing the oversets, I check to make sure the document ends on a left page; if not, I am using the code below to add an extra page. However, the page ends up as a second right hand page right next to the previous one. How do I ensure that the page I add is a left-hand page. Thanks in advance.
Rick Quatro
rick at frameexpert dot com
585-659-8267
// Set a variable for the active document.
var oDoc = app.activeDocument;
// Call a function to remove the oversets
//...
// Make sure the document ends on a left page.
if (oDoc.pages[-1].side == PageSideOptions.RIGHT_HAND)
{
AddPageAndLinkedTextFrame(oDoc);
}
function AddPageAndLinkedTextFrame(oDoc)
{
var oPage = oDoc.pages.add(LocationOptions.AFTER,oDoc.pages[-1]);
var oTextFrame = oPage.textFrames.add();
oTextFrame.geometricBounds = GetPageMarginBounds(oDoc,oPage);
oTextFrame.previousTextFrame = oDoc.pages[-2].textFrames[0];
}
Technical Details
Message-ID:
<59b76da9.-1@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossingShow Full Headers
Complete Article Headers
X-Google-Thread: f939a,4161abc188bd3c78,start X-Google-Attributes: gidf939a,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Rick_Quatro@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!newshub.sdsu.edu!webcrossing Newsgroups: adobe.scripting.indesign Subject: [JS CS3] Page side when adding pages Message-ID: <59b76da9.-1@webcrossing.la2eafNXanI> Date: Mon, 5 Jan 2009 06:01:16 -0800 Lines: 32 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit