Page 1 of 1
A quick way to count page breaks.
Posted: 2009-12-15 01:38:39
by loulesko
Hey there, can anyone give me a quick way to count the number of page breaks in a document. Preferably without using the Find All command, but if that's the only way no problem.
Thanks
Lou
Re: A quick way to count page breaks.
Posted: 2009-12-15 02:34:22
by Kino
You could check for all characters in the document but that is much more time-consuming. So you’d better use Find All.
Page/Section break is represented by
\f in PowerFind Pro mode. To exclude false page breaks in note area, you have to specify
-am as
where argument.
Code: Select all
$n = Find All '\f', 'E', '-am'
exit $n
Or you don’t want breaks to be selected? If so, use the following.
Code: Select all
$doc = Document.active
$sels = $doc.text.findAll '\f', 'E', '-am'
exit $sels.count
Re: A quick way to count page breaks.
Posted: 2009-12-15 09:15:05
by loulesko
Brilliant Kino.
I noticed that you have contributed a lot of awesome macros to the macro repository. Thanks for all your fantastic work, generous people like you, make life for people like me easier. Your work is very much appreciated.
Lou
Re: A quick way to count page breaks.
Posted: 2009-12-15 14:46:47
by martin
Kino is indeed a generous NWP macro superstar! We're all very lucky to have him as a Nisus user

Re: A quick way to count page breaks.
Posted: 2009-12-27 12:10:53
by loulesko
Kino,
Can you tell me where you found the documentation for the where argument in your find statement. I looked everywhere for it and I can't find it and I'd like to learn more about it.
thanks
Lou
Re: A quick way to count page breaks.
Posted: 2009-12-27 16:32:25
by Kino
loulesko wrote:Can you tell me where you found the documentation for the where argument in your find statement.
Open
Nisus Macro Reference.zrtf and search for “The where argument” which will be found in
Find and Replace section under
COMMANDS.
Re: A quick way to count page breaks.
Posted: 2009-12-27 19:00:28
by loulesko
Thanks, I had an older version of the macro reference.
Lou
Re: A quick way to count page breaks.
Posted: 2009-12-28 16:10:27
by martin
One can always view the current Macro Reference by using the menu Help > Macro Language Reference from within NWP.