Luciano,
OK, a bit more than 15 minutes, but I wanted to test this:
Step One -
You need to establish the message call back. One way to do this is in your
model load script with the following:
set MessageCallback "MessageCallback"
You can call the function anything you want. Here I'm calling it
"MessageCallback."
Step Two-
I find it easier to do this with global variables because I can't always
find an identifiable handle in the actual value I want. These two globals
will hopefully be clear to you in step Three:
var messageSwitch = false;
var residuesVar = "";
Globalize them by defining them outside any function.
Step Three-
Write an appropriate callback script in your function to get the value:
function MessageCallback(x, y, z) {
if (messageSwitch) { residuesVar = y; messageSwitch = false; }
if (z.toLowerCase().indexOf("show residues") > -1) { messageSwitch =
true; }
return null;
}
There may be a more elegant way to handle this, but I've had problems
getting z without the global trick above. For example, in "show center",
the word center is in Y - you could get it without the global two step
above. Other shows, however, do not appear to have an identifiable handle -
hence the two step with globals above.
residuesVar could of course be generic for any show value that you want to
capture. A statements like
if (z.toLowerCase().indexOf("show residues") > -1) { messageSwitch = true; }
could also be generalized for other shows.
Hastily written! Feel free to query me further...
Otis
--
Otis Rothenberger
o...@chemagic.com
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users