🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.scripting.indesign
2 messages
2 total messages Started by Rick_Quatro Mon, 05 Jan 2009 14:01
[JS CS3] Page side when adding pages
#2140
Author: Rick_Quatro
Date: Mon, 05 Jan 2009 14:01
27 lines
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];
}
Re: [JS CS3] Page side when adding pages
#2142
Author: Robert Tkaczyk
Date: Mon, 05 Jan 2009 22:56
12 lines
979 bytes
in "standard" document - without page shuffling, etc. - you can do something like this (VB):

if mydoc.pages.item(a) mod 2 then
  ' right page
else
  ' left page
endif

robin

-- 
www.adobescripts.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads