🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #1553

[CS4 JS] .lines.count() and .lines.length of small TextFrame

#1553
From: mfi
Date: Fri, 30 Jan 2009 13:07
35 lines
1484 bytes
Hi,

I don't know if I've come across a new behavior in InDesign CS4 or if the following is a bug; so I tought I'd open a new topic.

Suppose you have a TextFrame selected that is so small that no text is shown in the frame. If you now get the line-count of the frame with...

      var numOfLines = app.activeDocument.selection[0].lines.count();




... you get a value of 1. InDesign CS3 used to return 0.
Now if I try to get the baseline of this line with...

      var baseline = app.activeDocument.selection[0].lines.first().baseline;




... the following error is thrown...

      The property is not applicable in the current state.




... which is kind of clear, because there actually is no first line in the mentioned frame.

What do you think?
Is this a new behavior, or is it a bug in CS4?

I'm looking forward to your feedback.

Kind Regards,
Marco
Technical Details
Message-ID: <59b7bbb6.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,552b0635605037db,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: mfi@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.google.com!news.glorb.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: [CS4 JS] .lines.count() and .lines.length of small TextFrame
Message-ID: <59b7bbb6.-1@webcrossing.la2eafNXanI>
Date: Fri, 30 Jan 2009 05:07:04 -0800
Lines: 29
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit