Dear All,

  I've been playing around with some of the "molecular math" features of
Jmol - it's truly amazing how easy it is to analyze a large number of
structures.  My only difficulty has been getting the results out to a simple
text file.

At first I tried copying the text from the console - doesn't seem to work
(at least on OS X).

For simple scripts I was able to say:
output = script("echo hello world"); write VAR output "output.txt";

But this is cumbersome with longer scripts or with scripts that have quotes
in them.

The following seems to work (I just figured this out...):
output = script("script \"myscript.spt\""); write VAR output "output.txt";

Am I missing an easier (cleaner?) way to do this?  I guess I'd like to be
able to tell the script("...") command that what is in the quotes is a path
to a file.

Just FYI, here is a bit of what I'm doing with this (the file is the results
of a search on the Cambridge Structure Database with about 100 structures).
The structures are all metal clusters and I'm calculating the average
distance from the center of the cluster to each of the bridging ligands in
the structure.  Pretty cool...

nModel = getProperty("modelInfo", "modelCount");
for (x = 1; x <= nModel; x = x+1);
    name = getProperty("modelInfo", "models", @x, "name").trim("CSD_CIF");
    model @x;
    print "Model #" + x + ": " + name;
    bridging = (connected(3,{molybdenum}) && {model = @x});
    moly = ({molybdenum} && {model = @x});
    print "Bridging atoms: " + bridging.label("%e").join(" ");
    print "Bridging distance = " + bridging.distance(moly);
    print "";
end for;
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to