Skip to main content
Known Participant
September 20, 2009
Answered

[AS][CS3] counting paragraph lines

  • September 20, 2009
  • 1 reply
  • 2777 views

Hi!

Is there a way to count how many lines of text there are on a paragraph and then add some line breaks if there are not enough lines?

jukka

This topic has been closed for replies.
Correct answer sstanleyau

"count of lines" will give you the number of lines. To add extra lines, just set the contents of the chosen insertion points to newline.

--

Shane Stanley <sstanley@myriad-com.com.au>

AppleScript Pro, April 2010, Florida <http://www.applescriptpro.com>

1 reply

sstanleyauCorrect answer
Inspiring
September 20, 2009

"count of lines" will give you the number of lines. To add extra lines, just set the contents of the chosen insertion points to newline.

--

Shane Stanley <sstanley@myriad-com.com.au>

AppleScript Pro, April 2010, Florida <http://www.applescriptpro.com>

Known Participant
September 21, 2009

Thanks Shane!

It was right under my nose, i must be blind!

jukka

Known Participant
September 21, 2009

Another problem.

I found all the paragraphs that i need, i get the number of lines and if the count of lines is not enough i'll insert returns to the end of paragraph with this loop:

repeat with j from 1 to (11 - theNum)
        set contents of insertion point -1 of theParagraph to return           
end repeat


This works great with first found paragraph but following paragraphs insertion point -1 is not at the end of paragraph.

Baffled...