Difference between revisions of "Macro"

From Jmol
Jump to navigation Jump to search
m (Templates)
(Jmol Macro's)
Line 1: Line 1:
 
=== Jmol Macro's ===
 
=== Jmol Macro's ===
  
A Jmol macro is a small script that provides some reusable functionality for the [[Jmol Application]]. It is saved as a simple text file like any other script in the {{Directory|$HOME/.jmol/macros}} subdirectory. It will show up in then Macro menu of the Jmol application.
+
A Jmol macro is a small script that provides some reusable functionality for the [[Jmol Application]]. It is saved as a simple text file, like any other script, in the {{Directory|$HOME/.jmol/macros}} subdirectory. It will show up in the Macro menu of the Jmol application.
 +
 
 +
'''Windows''': the {{Directory|$HOME}} folder's location is stored in the environment variable <code>%USERPROFILE%</code> or in the environment variables <code>%HOMEDRIVE%</code> and <code>%HOMEPATH%</code>; it will usually be at
 +
<code>c:\Documents and Settings\(yourUserName)\</code>
 +
 
 +
If you don't find it, try
 +
: My PC > right-click > Properties > Advanced options tab > Environment variables
 +
: or open a command line and type <code>set</code>
 +
 
 +
 
 +
The macro file is a text file with the extension <code>macro</code>, and its
 +
contents must be two lines, starting with "Title=" and "Script=" (only one macro per file).
 +
 
 +
==Example macro:==
 +
 
 +
To show the protein and nucleic acids as cartoons and the ligands as
 +
balls-and-sticks, create a text file, write this:
 +
<pre>
 +
Title=PDB view
 +
Script=select all; spacefill off; wireframe off; cartoon; color cartoon chain;
 +
select ligand; wireframe 40; spacefill 120
 +
</pre>
 +
and save as <code>macromol.macro</code> (or the name you like) in the folder {{Directory|$HOME/.jmol/macros}}
 +
 
 +
Then to use it, open Jmol application, open menu "Macros", and there you will have a "PDB view" entry.

Revision as of 16:00, 24 May 2006

Jmol Macro's

A Jmol macro is a small script that provides some reusable functionality for the Jmol Application. It is saved as a simple text file, like any other script, in the $HOME/.jmol/macros subdirectory. It will show up in the Macro menu of the Jmol application.

Windows: the $HOME folder's location is stored in the environment variable %USERPROFILE% or in the environment variables %HOMEDRIVE% and %HOMEPATH%; it will usually be at c:\Documents and Settings\(yourUserName)\

If you don't find it, try

My PC > right-click > Properties > Advanced options tab > Environment variables
or open a command line and type set


The macro file is a text file with the extension macro, and its contents must be two lines, starting with "Title=" and "Script=" (only one macro per file).

Example macro:

To show the protein and nucleic acids as cartoons and the ligands as balls-and-sticks, create a text file, write this:

Title=PDB view
Script=select all; spacefill off; wireframe off; cartoon; color cartoon chain; 
select ligand; wireframe 40; spacefill 120

and save as macromol.macro (or the name you like) in the folder $HOME/.jmol/macros

Then to use it, open Jmol application, open menu "Macros", and there you will have a "PDB view" entry.