Article View: adobe.scripting.indesign
Article #20610Re: Insertion points?
From: Olav Kvern
Date: Sat, 15 Jun 2002 16:39
Date: Sat, 15 Jun 2002 16:39
23 lines
2552 bytes
2552 bytes
Mike-- Don't worry about it!<g> I'm not quite clear on what you mean when you say "the first paragraph"--do you mean the selected paragraph, or the first paragraph in the story, or the first paragraph in the text frame? I take it that "the frame" you want to determine the x and y for is the new frame, not the frame containing the selection? I'll be happy to run up an example once I understand exactly what it is you're trying to do. But--a few notes, first (given a paragraph reference "myParagraph"): 1. myParagraph.InsertionPoints.Item(1).Baseline returns the y position of the baseline of the first line in the paragraph. 2. myParagraph.InsertionPoints.Item(myParagraph.InsertionPoints.Count-1).Baseline returns the y position of the last line of the paragraph. 3. From either of the above references, .Ascent provides the distance from the baseline of the top of the line; .Descent gives you the distance from the baseline to the lowest descender in the line. 4. The horizontal position is a little bit more difficult to calculate. .HorizontalOffset provides the X location, but that might not be the beginning or end of the line due to paragraph's first line indent (at the start of the paragraph) or alignment (at the end of the paragraph). It's easier to get the x position of the edges of the text frame and take the paragraph indents into account. Examples of the use of the text-object-to-page-coordinates properties can be found in BoxCharacters and FitFrameToText. And TabUtilities, now that I think of it. Anyway, it sounds like you're trying to create an inline text frame that takes up the same position on the page as the selected paragraph. Is that it? If so, I can run up an example that does exactly that, if you'd like. Thanks, Ole
Technical Details
Message-ID:
<ef92471.0@WebX.aaQKaf7vad4>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.wirehub.nl!logbridge.uoregon.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<ef92471.-1@WebX.aaQKaf7vad4>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,d17bc06bfa9ea738 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2002-06-15 10:07:46 PST From: "Olav Kvern" <okvern@adobe.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!newsfeed.wirehub.nl!logbridge.uoregon.edu!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Insertion points? Message-ID: <ef92471.0@WebX.aaQKaf7vad4> Date: Sat, 15 Jun 2002 09:39:29 -0700 References: <ef92471.-1@WebX.aaQKaf7vad4> Lines: 43 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit