There is an compile-time option of adding a script interpreter. Currently the options are python and guile. It seems possible that in future you will be able to use both in the same executable. The binary distribution of Coot are linked with guile, others with python.
Hundreds of commands are made available for use in scripting by using SWIG, some of which are documented here. Other functions documented less well, but descriptions for them can be found at the end of this manual.
Commands described throughout this manual (such as (vt-surface
1)) can be evaluated
directly by Coot by using the “Scripting Window” (Calculate
-> Scripting...). Note that you type the commands in the upper
entry widget and the command gets echoed (in red) and the return value
and any output is displayed in the text widget lower (green). The typed
command should be terminated with a carriage return 1. Files 2 can be evaluated (executed)
using Calculate -> Run Script....
Note that in scheme (the usual scripting language of Coot), the parentheses are important.
To execute a script file from the command line use the --script
filename arguments
(except when also using the command line
argument --no-graphics, in which case you should use -s
filename).
After you have used the scripting window, you may have noticed that you can no longer kill Coot by using Ctrl-C in the console. To recover this ability:
(exit)
in the scripting window.
[1] which causes the evaluation of the command.
[2] such as the Coot state file (Section Coot State).