Reply to topic  [ 8 posts ] 
A quick way to count page breaks. 
Author Message
User avatar

Joined: 2008-01-20 11:08:35
Posts: 89
Location: California
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


2009-12-15 01:38:39
Profile WWW

Joined: 2008-05-17 04:02:32
Posts: 400
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:
$n = Find All '\f', 'E', '-am'
exit $n
Or you don’t want breaks to be selected? If so, use the following.
Code:
 $doc = Document.active
$sels = $doc.text.findAll '\f', 'E', '-am'
exit $sels.count


2009-12-15 02:34:22
Profile
User avatar

Joined: 2008-01-20 11:08:35
Posts: 89
Location: California
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


2009-12-15 09:15:05
Profile WWW
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
Kino is indeed a generous NWP macro superstar! We're all very lucky to have him as a Nisus user :)


2009-12-15 14:46:47
Profile WWW
User avatar

Joined: 2008-01-20 11:08:35
Posts: 89
Location: California
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


2009-12-27 12:10:53
Profile WWW

Joined: 2008-05-17 04:02:32
Posts: 400
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.


2009-12-27 16:32:25
Profile
User avatar

Joined: 2008-01-20 11:08:35
Posts: 89
Location: California
Thanks, I had an older version of the macro reference.

Lou


2009-12-27 19:00:28
Profile WWW
Official Nisus Person
User avatar

Joined: 2002-07-11 17:14:10
Posts: 4251
Location: San Diego, CA
One can always view the current Macro Reference by using the menu Help > Macro Language Reference from within NWP.


2009-12-28 16:10:27
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software