Where are the sample macros?

Get help using and writing Nisus Writer Pro macros.
Post Reply
js
Posts: 259
Joined: 2007-04-12 14:59:36

Where are the sample macros?

Post by js »

I tried a simple macro, like this

$my_text = Read Selection
Find $my_text, a

without the "a" at the end it works as expected: The selected text is picked up and a Find Next is executed.
After reading the manual I expected that adding ", a" would do a Find All. Why does this not work?

Also I wonder where to find the sample macros indicted in the manual. When I opened Pro first, I found my original macro file from Express.
User avatar
martin
Official Nisus Person
Posts: 5227
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Where are the sample macros?

Post by martin »

js wrote:I tried a simple macro, like this

$my_text = Read Selection
Find $my_text, a

without the "a" at the end it works as expected: The selected text is picked up and a Find Next is executed.
After reading the manual I expected that adding ", a" would do a Find All. Why does this not work?
The Find statement takes two arguments. Each of these arguments needs to be something that yields a string value (a sequence of letters). The value of the variable $my_text is a string, specifically the selection you assigned it earlier. The letter a is however nothing that yields a value. What the macro language requires is that you tell it you want a string containing the letter a. You do this by enclosing it in quotation marks.

To review, the following are all valid macros:
Find "whatever"
Find "whatever", "a"
$text = "whatever"
Find $text
$text = "whatever"
Find $text, "a"
$text = "whatever"
$options = "a"
Find $text, $options
Post Reply