Currently, a Quickeys macro applies a paragraph style, types the brackets, and puts the cursor inside. It occurred to me that the functionality of this macro could be extended, not so much for convenience as a fun way to learn Nisus’ macro language.
What I want the macro to accomplish is to search backwards in the document to the previous page number, select the number part, increment this with +1, go back to the end, and paste the next page number complete with square brackets and paragraph style.
By scrupulous perusal of the Nisus macro reference, I found out how to find the previous page number (was I proud!).
Code: Select all
Find '\[[0-9]+\]', 'Emr'
Now I’m stuck on the hard part: how to manipulate the result. I must confess that I’m slightly dizzied by what seems to be a myriad of options in the macro reference. There must be a way to
1) select the numerical part of the found string (or to strip the brackets),
2) increment the resulting value with +1
I would appreciate any pointers in the right direction. The rest of the macro I believe I can figure out on my own.