0 Replies Latest reply on Jan 30, 2009 5:07 AM by Mfi Previon

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

    Mfi Previon

      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,