ChimeraX docs icon

Command: alias

alias  namewordlist ]

alias  listinternal ]

alias  deletename | all )

The alias 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.

For assigning a name to a selection or longer target specification, see the name command instead. See also: buttonpanel, user-defined presets

Aliases are saved in sessions. The command alias list lists the current user-defined aliases in the Log, whereas alias list internal lists the built-in aliases. The definition of a specific alias can be shown with alias name.

The delete option can be used to “forget” a specific alias or all aliases.

Within wordlist, $1, $2, $3 ... may be used to indicate the first, second, third ... arguments of name. A string that contains spaces can be designated as a single argument by enclosing it in single or double quotation marks. The quotation marks will be omitted when the alias is expanded. For example,

alias ribcolor color $1 $2 targ c
ribcolor '/a & helix' 'dodger blue'
is equivalent to
color /a & helix dodger blue targ c

An example of multiple commands, in this case without arguments:

alias reset view orient; view initial

UCSF Resource for Biocomputing, Visualization, and Informatics / June 2019