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 » 2008-03-11 17:40:49

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

Thanks

User avatar
gemboy27
Posts: 351
Joined: 2003-09-30 21:33:58
Contact:

\n

Post by gemboy27 » 2008-03-11 20:59:41

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 » 2008-03-13 08:37:59

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: 4290
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Post by martin » 2008-03-13 12:04:17

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