Writing an invalid command in a macro, Working with menu commands, Looping and accessing other macros – Nisus Writer Pro User Manual

Page 420: Call one macro from another

Advertising
background image

400

Macros, Skimming the Surface

Writing an invalid command in a macro

If you use a command that does not exist or you spell the name incorrectly, Nisus Writer Pro beeps
and presents an alert informing you that the command does not exist. The alert identifies the line of
the error and lets you choose to stop, continue or open the macro to edit it.

Figure 426

The unknown macro command alert

Menu commands sometimes have the same name but perform different actions and belong to
different menus. This only happens if you create menu commands (macros, file names, or window
names) that conflict with the standard commands (or with other macros). To resolve conflicts in a
macro, precede the command by the menu name followed by a colon. For example you may have a
macro that does something special when you copy selections and have named it Copy. In such a
case, writing Macro:Copy in your instructions will call that macro.

Working with Menu Commands

To use a menu command in a macro, simply type its name on a separate line. For example, the
macro instructions below selects all text in a document, changes the font to Lucida Grande, and the
style to bold
Select All
Lucida Grande
Bold
To include arguments in Menu Command macro instructions see “Macros, the Deeper Workings” on
page 401.

Looping and Accessing Other Macros

A macro can access any other macro in the Macros menu. Invoking one macro from within another
is like running any other menu command. Write the name of the macro to be invoked on its own
separate line in the macro performing the call.

Call one macro from another

A Nisus Writer Pro macro can call any command on the menus of Nisus Writer Pro. This includes
other macros and open files.

Write the macro name on its own line in the macro (UPPERCASE or lowercase is not significant

when writing a menu command’s name).

If your macro’s name conflicts with another menu command, write this command as

Macro:MacroName.

Advertising