Conditionals

Get help using and writing Nisus Writer Pro macros.
Post Reply
mwiseman
Posts: 18
Joined: 2008-02-26 13:46:29

Conditionals

Post by mwiseman »

I'd like to have a macro ensure that the Menu Command "View:Show Invisibles" is "On."

I see I can toggle it "On" and "Off" with the simple line of:

View:Show Invisibles

But is there a way to do a conditional?

This example does not work:

#Toggle On Invisible Characters
If ‘View:Show Invisibles’ = ‘False’
View:Show Invisibles
end


What would work?
User avatar
martin
Official Nisus Person
Posts: 5228
Joined: 2002-07-11 17:14:10
Location: San Diego, CA
Contact:

Re: Conditionals

Post by martin »

There is currently no way to check the state of "show invisibles". However, even if there were, your code would not work for two reasons. First "=" is an assignment. If you want to compare two values you should use "==". Also 'False' is a string that is not the same as the keyword false (or False). Thus the hypothetical code would be:

If 'View:Show Invisibles' == false

That said, turning invisibles on unconditionally is possible using this simple line:

Code: Select all

Set Invisibles Shown true
You can find a list of all available commands in the Nisus Macro Reference, which is distributed in the NWP disk image.
mwiseman
Posts: 18
Joined: 2008-02-26 13:46:29

Post by mwiseman »

You can find a list of all available commands in the Nisus Macro Reference, which is distributed in the NWP disk image.
Can you tell me where I would find this. I have search "help.pdf" and I see Nisus Macro Reference mentioned in the NWP 1.0.3 release notes under changes for 1.0.2, but I do not find a Nisus Macro Reference anywhere. I have found pp234-264 and pp317-339 of the "help.pdf" useful. While "invisibles" shows up in several places in the "help.pdf" I do not see it in the context of a "list of available commands."

I really appreciate your help. and the "Set Invisibles as true" line is exactly the solution I was looking for.

I'd love to see more documentation. I'd also be happy to participate in indexing and bookmarking "help.pdf" I've been creaking my own as I go. I'm sure other would appreciate bookmarks, too.
User avatar
Hamid
Posts: 777
Joined: 2007-01-17 03:25:42

Post by Hamid »

'Nisus Macro Reference' file (with bookmarks) was included in the 'Read Me' folder on the same disk image 'Nisus Writer Pro' which contained NWP 1.0.3.
Post Reply