Article View: adobe.scripting.indesign
Article #8867Re: VB Help - Automating frames and flow...
From: Robert Tkaczyk
Date: Thu, 21 Sep 2006 22:09
Date: Thu, 21 Sep 2006 22:09
100 lines
3563 bytes
3563 bytes
> Figured it out - now if someone can help me figure out how to find out if there are master text frames!
Property MasterPageItems As Variant
read-only
Member of InDesign.Page
All items on the applied master pages that have not been overridden
as Array of PageItems, Guides, Graphics, Movies or Sounds
but "MasterTextFrame" don't have any special/unique marker ;)
and few more clues:
> Set inD = CreateObject("InDesign.Application.CS2")
> Set theDoc = inD.Documents(1)
Set theDoc = inD.ActiveDocument
> Set thePg = theDoc.Pages.LastItem
Set thePg = theDoc.Pages.Item(-1)
> Set theFrame = thePg.TextFrames.LastItem
Set theFrame = thePg.TextFrames.Item(-1)
> 'get the size we are going to make the text box
>
> With theDoc
>
> pgWidth = .DocumentPreferences.PageWidth
> PgHeight = .DocumentPreferences.PageHeight
> MgnBottom = .MarginPreferences.Bottom
> MgnRight = .MarginPreferences.Right
>
> theTop = .MarginPreferences.Top
> theLeft = .MarginPreferences.Left
> theBot = PgHeight - MgnBottom
> theRight = pgWidth - MgnRight
> End With
>
> FrmBounds = Array(theTop, theLeft, theBot, theRight)
>
> Do Until theFrame.Overflows = False 'keep going until there's no more text
> theDoc.Pages.Add (idAtEnd)
> Set newPg = theDoc.Pages.LastItem
Set newPg = theDoc.Pages.Add (idAtEnd)
> If newPg Mod 2 <> 0 Then 'right hand page
in CS2 there is new property:
Property Side As idPageSideOptions
read-only
Member of InDesign.Page
The side of the spread on which this page lies
Const idLeftHand = 1818653800 (&H6C667468)
Member of InDesign.idPageSideOptions
To the left of the spread's binding spine
Const idRightHand = 1919382632 (&H72677468)
Member of InDesign.idPageSideOptions
To the right of the spread's binding spine
Const idSingleSided = 1970496888 (&H75736578)
Member of InDesign.idPageSideOptions
Single-sided page
> FrmBounds = Array(theTop, theLeft + pgWidth, theBot, theRight + pgWidth)
maybe try to use Page.Bounds:
Property Bounds As Variant
read-only
Member of InDesign.Page
The bounds of the Page, in the format (top, left, bottom, right) as
Array of 4 Units (Doubles or Strings)
> Else
> FrmBounds = Array(theTop, theLeft, theBot, theRight)
maybe try to use Page.Bounds - like abowe
> End If
>
> With newPg
> Set NewFrame = .TextFrames.Add("Layer 1")
> NewFrame.GeometricBounds = FrmBounds 'works 1st time on LH page, breaks on next RH page
> NewFrame.PreviousTextFrame = theFrame
> End With
>
> Set theFrame = newPg.TextFrames.LastItem
>
> Loop
robin
--
www.adobescripts.com
Technical Details
Message-ID:
<6178B7D31F74D161EC38EFCB7192472A@in.webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!news.isoc.lu!webcrossingReferences:
<3bc1b9db.-1@webcrossing.la2eafNXanI> <3bc1b9db.0@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,26055e7a19463a28 X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: Robert Tkaczyk <indesignscripts@wp.pl> Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.germany.com!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: VB Help - Automating frames and flow... Message-ID: <6178B7D31F74D161EC38EFCB7192472A@in.webcrossing.la2eafNXanI> Date: Thu, 21 Sep 2006 15:09:06 -0700 References: <3bc1b9db.-1@webcrossing.la2eafNXanI> <3bc1b9db.0@webcrossing.la2eafNXanI> Lines: 106 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) X-Antivirus: avast! (VPS 0638-0, 2006-09-19), Outbound message X-Antivirus-Status: Clean MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit