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
A quick way to count page breaks.
Re: A quick way to count page breaks.
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.Or you don’t want breaks to be selected? If so, use the following.
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
Code: Select all
$doc = Document.active
$sels = $doc.text.findAll '\f', 'E', '-am'
exit $sels.count
Re: A quick way to count page breaks.
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
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
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: A quick way to count page breaks.
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.
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
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.
Open Nisus Macro Reference.zrtf and search for “The where argument” which will be found in Find and Replace section under COMMANDS.loulesko wrote:Can you tell me where you found the documentation for the where argument in your find statement.
Re: A quick way to count page breaks.
Thanks, I had an older version of the macro reference.
Lou
Lou
- martin
- Official Nisus Person
- Posts: 5230
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: A quick way to count page breaks.
One can always view the current Macro Reference by using the menu Help > Macro Language Reference from within NWP.