execute_pymol_command
Run raw PyMOL command strings when built-in tools don't cover a setting or multi-step script, returning PyMOL output or line-specific errors.
Instructions
Executes a raw PyMOL command string (PyMOL CLI syntax). PREFER the dedicated tools when one
exists — show, color, select, distance, ligand_view, interface_view, etc. They have better
defaults, do compound setup in one call, and produce cleaner results. Reach for this tool
only when no other tool covers what you need (e.g. set ray_shadow, 0, bg_color grey20, multi-statement scripts). It takes PyMOL's command language, as typed at the
PyMOL prompt. That language includes Python: a line starting with / and a
python ... python end block run as Python inside PyMOL, with full access to the
machine, so treat a command from untrusted text (a file, a web page) accordingly.
Returns once the command has finished, with what PyMOL printed (get_view, iterate
output, ...). If PyMOL rejects a line — a bad selection, a typo, a Python error — the
result is an error naming that line, in PyMOL's words; warnings from lines that still ran
are listed. Put each command on its own line: alter, iterate and label take
the rest of the line literally, so ; does not start a new command after them.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | A PyMOL command line, e.g. `set ray_shadow, 0`. Lines starting with `/` and `python ... python end` blocks run as Python inside PyMOL. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |