
Hi Oliver, Yeah, as you observed, only Chimera command files can be specified for reading at startup in the Command Line section of Preferences. Here’s one idea using the Presets section of the Preferences instead. I haven’t actually tried it but I think it should work. Custom preset definitions are read at startup and they can be defined in either Chimera command or Python files, see: <http://www.rbvi.ucsf.edu/chimera/docs/UsersGuide/preferences.html#Presets> You could just think of your Python-defined preset as an alias (or macro or function definition). The name of the preset comes from the name of the file. You can execute it with the preset command, which could occur in a Chimera command file. I don’t know if it could be in a startup command file… I guess it depends on whether the custom presets are read before the startup command file or not. I hope this helps, Elaine ----- Elaine C. Meng, Ph.D. UCSF Computer Graphics Lab (Chimera team) and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco On Sep 11, 2015, at 2:11 PM, Oliver Clarke <olibclarke@gmail.com> wrote:
Incidentally, is there any easy way to add python code snippets to a Chimera command file (with aliases etc)? I guess the only ways are to either have it in a separate file and use open or runscript, or to make it one big python file and wrap all of the aliases in runcommand() calls. But then how does one tell Chimera to run a given python file at start up? When I add python files to the “Files to read at startup” section of preferences, Chimera seems to interpret them as Chimera command files, and hence gives an error.
Cheers, Oliver.