Skip to main content
Inspiring
February 7, 2023
Answered

how to find size of text in a text frame

  • February 7, 2023
  • 2 replies
  • 508 views

Hi, I am trying to add text to document.

I am creating text frames that are large enough to contain the text that is inserted. Now I would like to get the actual size (number of lines) used. The rowCount variable is always 1, and the geometricBounds and height values describe the text frame as created

This topic has been closed for replies.
Correct answer Met1

app.activeDocument.textFrames[index].lines

(I'm not a scripter so your mileage may vary)

2 replies

m1b
Community Expert
Community Expert
February 7, 2023

Just for some extra info about scripting text in Illustrator, please have a look at the TextFrame docs, and maybe have a look at my scripts here and here for some example usage - Mark

Met1
Met1Correct answer
Legend
February 7, 2023

app.activeDocument.textFrames[index].lines

(I'm not a scripter so your mileage may vary)

Inspiring
February 7, 2023

Hi, many thanks, this works fine

Actually, the lines variable is an array, and so lines.length is the actual number of lines