Line Counts

Get help using and writing Nisus Writer Pro macros.
Post Reply
mwiseman
Posts: 18
Joined: 2008-02-26 13:46:29

Line Counts

Post by mwiseman »

Can anyone suggest a way to count lines? Counting "\n" occurrences would do. I'm looking to get this number into a "$variable"

Thanks
gemboy27
Posts: 355
Joined: 2003-09-30 21:33:58

\n

Post by gemboy27 »

if you do a find all of '\n'

it will highlight all new lines and then in the finder window list all the \n that were found

It seems like an applescript should work to, but I am just learning that...

...and not that fast
I have never let my schooling interfere with my education/Mark Twain (1835-1910)
mwiseman
Posts: 18
Joined: 2008-02-26 13:46:29

Post by mwiseman »

Great suggestion... I can view the count in statistics or capture it to a variable in a macro. Thanks.
User avatar
martin
Official Nisus Person
Posts: 5228
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin »

The Find macro command returns the number of occurrences that matched, so it should be as simple as:

Code: Select all

$newlineCount = Find All "\n"
Post Reply