Article View: adobe.scripting.indesign
Article #20651Re: Current Page
From: Olav Kvern
Date: Fri, 28 Jun 2002 19:06
Date: Fri, 28 Jun 2002 19:06
23 lines
1506 bytes
1506 bytes
Stuart-- Something like this: Rem Given a Paragraph myParagraph, and a Document myDocument... Set myTextFrame = myParagraph.ParentTextFrame Set myPage = myFindParentPage(myInDesign.ActiveDocument, myTextFrame.Parent) myName = myPage.Name End Sub Rem Recursive function for finding the parent page. Private Function myFindParentPage(myDocument, myParent) Do While TypeName(myParent) <> "Page" ����Set myParent = myParent.Parent Loop Set myFindParentPage = myParent End Function This will probably fail if the paragraph is in overset text, or if the paragraph is on the pasteboard, but it'll find the parent page if the text frame containing the paragraph is in a group or is pasted inside another frame. I can provide a more complete example to cover the error cases, if you like. Thanks, Ole
Technical Details
Message-ID:
<ef95bc8.0@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<ef95bc8.-1@WebX.aaQKaf7vad4>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,6117df405b39cac7 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-06-28 12:09:38 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!news.maxwell.syr.edu!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Current Page Message-ID: <ef95bc8.0@WebX.aaQKaf7vad4> Date: Fri, 28 Jun 2002 12:06:03 -0700 References: <ef95bc8.-1@WebX.aaQKaf7vad4> Lines: 28 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit