Macro Command Mockup

Quick links and legend:

The following is meant to cover the action-defining function of Chimera1 alias (a separate command will still be used for the target-defining function). I think we can retire the “^” because of this split.

It's written up as macro below, but in Oct 2015 discussions we decided to leave it as alias.

Usage:
macronamewordlist ]]

Usage:
~macroname ]

The macro command defines a new command name as the specified wordlist, which could be a composite of other commands. That is, wordlist may contain multiple commands separated by semicolons. Subsequent uses of name as a command (at the beginning of a line, following a semicolon, or as a command argument of perframe) will be replaced with wordlist. See also: alias

Macros (user-defined command names) are saved in sessions. Macros that do not require arguments (see below) are also saved in the preferences file and listed in a top-level Macros menu. Choosing an entry in the Macros menu executes the alias.

The macro command without arguments shows the definitions (expansions) of all existing macros, and the definition of a specific macro can be shown with macro name.

The command ~macro without arguments deletes all macros, whereas a specific macro can be deleted with ~macro name.

Within wordlist, $1, $2, $3 ... may be used to indicate the first, second, third ... arguments of name. To have a string with spaces in it handled as a single argument, replace each space with an underscore. Any underscores will be replaced with spaces before the command is executed. For example,

macro ^colorsrf color $1 $2 target s
alias helix5 /a:200-228
colorsrf helix5 light_sea_green
is equivalent to
color /a:200-228 light sea green target s
which colors the molecular surface patches of the specified residues light sea green.