Macro form of Find (and Replace) not illustrated in Manual

Get help using and writing Nisus Writer Pro macros.
Post Reply
User avatar
Patrick J
Posts: 124
Joined: 2006-06-16 16:17:50
Location: Brighton & Hove, UK
Contact:

Macro form of Find (and Replace) not illustrated in Manual

Post by Patrick J » 2013-11-19 19:00:24

On page 409 of the manual it has this:

Find and replace
Find text, [options]
Finds and selects the given text. Options is a string, each letter turning on a separate feature.

This gives the impression that you just put the find string after Find and then the options in square brackets, like this:

Find Patrick, [r]

To mean Find the string "Patrick" going backwards through the document.

However you actually use single quotes like this:

Find 'Patrick', 'r'

I don't think that someone totally new to Nisus Writer would be able to work out how to do this from this section in the manual.

The example for Find and Replace has the same problem.
Patrick

User avatar
phspaelti
Posts: 916
Joined: 2007-02-07 00:58:12
Location: Japan

Re: Macro form of Find (and Replace) not illustrated in Manu

Post by phspaelti » 2013-11-20 04:26:31

While I sort of see your point, the problem is no different from any other argument. Throughout the macro reference there are many arguments for many different commands, and they all work the same: you can specify them as explained in the Literals section, or you can pass them as variables.

In the case you specify you could do it like this:

Code: Select all

$findExpression = 'Patrick'
$options = 'r'
Find $findExpression, $options
Since in this case I'm using variables, I don't need quotes. (Of course I need quotes, when I assign them to the variables instead.).
Also the brackets represent that the argument is optional.

In the end the Macro Reference is a reference, and so it's style is rather dense. A good introduction to writing macros still needs to be written (by somebody).
philip

User avatar
Patrick J
Posts: 124
Joined: 2006-06-16 16:17:50
Location: Brighton & Hove, UK
Contact:

Re: Macro form of Find (and Replace) not illustrated in Manu

Post by Patrick J » 2013-11-20 14:57:22

Thank you Philip, now I understand why it is the way it is.

I have just been looking through the manual for useful things rather than reading it in a sensible way.

I do think that using the Find/Replace commands in combination with the Menu Commands is really powerful and very simple.

In the old classic Nisus Writer manual I think the Find/Replace commands were included in the menu commands part and there was an illustration as to how to lay it out.
Patrick

Post Reply