Using menu commands, Using parameters with menu commands, Using parameters with menu commands” below) – Nisus Writer Pro User Manual

Page 422

Advertising
background image

402

The Nisus Writer Pro Macro Language

Macros, the Deeper Workings

Several other additional instructions, including

looping (while…)

control (if…)

variables

are used in the Menu Command Dialect.
The Menu Command Dialect does not currently support any calculations. Any calculations must be
done in Perl blocks with the result returned to the Menu Command Dialect. Nonetheless, Nisus
Writer Pro comes with a folder of calculation macros that you can use and study.

Using menu commands

All menu commands are case insensitive.

Menu commands that are unique you can call as they appear on the menus:
Bold

You can call each menu command using the full menu path with colon separators between its
parts:
Format:Underline:Single
must be distinguished from:
Format:Strikethrough:Single

All the standard menu commands of Nisus Writer Pro function exactly the same as they do if you
had chosen them from the menu using the mouse or trackpad or a keyboard shortcut and require
no further explanation.

Using parameters with menu commands

Many Menu Commands accept a variety of parameters, that limit or define!the scope of that
particular command, as arguments. Arguments must be!separated from one another using commas
and many of them must be inside!quotes. An argument can take one of the following forms:

An “integer value”
eg:!7, 49 or 318.

!

Nisus Writer Pro does not currently support decimal numbers.

A “string literal” surrounded in single (straight, dumb) quotation marks,
eg:!'hello'.
Single-quoted strings are not interpreted or modified!in any way. The only exception is when
you want to include a single quote inside the string itself. You must “escape” the quote by
preceding it with a backslash, eg: 'don\'t'.

A “variable name”, which is always prefixed with a dollar sign,
eg:!$myVariable.

An “interpolated string literal”, which uses double quotes,
eg:!"hello $name". Interpolated means that the string is first scanned for special character
sequences which are!replaced before passing the value to the command. The kinds
of!replacements that occur are similar to those used by Perl and include the following:

Advertising