Before creating a macro, Typing menu commands, Create a new macro file – Nisus Writer Express User Manual

Page 267: Save the current macro file under a different name, Case sensitivity in menu command dialect macros, A simple “to do” list, Writing an invalid command in a macro

Advertising
background image

Customizing & Automating Solutions

247

When you load a macro file, Nisus Writer Express displays it as a command in the Macro menu.

Before Creating a Macro

Consider these basics before you create a macro

Determine the overall purpose of the macro. Do you plan to use the macro frequently? Or just
once? Will others find the macro useful?

Think of a descriptive name for the macro. Use names that correspond to the operation the
macro performs.

Macro names are not case sensitive.

When writing a macro, the menu items in Nisus Writer Express should appear as they appear
on the menus. (Neither case nor ellipses (“…”) are significant.)

Typing Menu Commands

You can tell Nisus Writer Express what to do just as you would type out a “to do” list for yourself.
Anything that Nisus Writer Express can do by choosing a menu command with the mouse can be
done in a macro by typing the name of that command.

Create a new macro file

The following instructions work for either a Perl script or a Nisus Writer Express command language
macro.

1.

Choose New Macro from the Macro menu.

2.

Write the instructions of your macro.

3.

Choose Save As Macro… from the Macro menu.

4.

In the Save As sheet that appears, notice that the location already points to your Macros folder

~/Library/Application Support/Nisus Writer/Macros
You can save the files elsewhere.

5.

Choose Nisus Macro or Nisus Perl Macro from the File Format pop-up menu in the sheet and
click Save.

Save the current macro file under a different name

1.

Press

A as you choose a particular macro from the Macro menu to open the macro file for

editing (rather than running) the macro.

2.

Choose Save As… from the File menu to give the macro file a new name.

Case sensitivity in Menu Command Dialect macros

You do not need to be precise about using upper or lowercase characters because Nisus Writer
Express pays no attention to them. If a menu command appears in a submenu, type only the
command of the submenu. You can ignore ellipses, but be sure to include any spaces in the
command’s name.

A simple “to do” list

The two commands that follow, when put together in sequence as a macro will make UPPERCASE
all but the initial letters of every word in a selection no matter what the case of the characters was
before
To Capitalized
To Toggled Case

Writing an invalid command in a macro

If you use a command that does not exist or you spell the name incorrectly, Nisus Writer Express
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.

Advertising