Jonathan-
> Any ideas?
>
I had exactly the same problem. I finally used the following approach
to "copy/paste" state from one applet to another in Jmol 11.9.9. I do
not use jmol.js, so some of the function calls may seem strange to
you. Nevertheless, I think that the basic concept below is readable.
One Note: Some time is needed between "copy" and "paste." I use user
lag time in making a transfer manually. For automatic transfer, you
may need to use a JavaScript setTimeout delay between "copy" and
"paste."
Use show state to pass state as a message:
function copyMol() {
if (feedbackFlag) { feedback(r[9]); } // Relevant to my page only.
evalRasmol("select *"); // My script eval function. Its name is
obviously historic!
evalRasmol("show state;delay 2;");
mepsData["tempHold"] = mepsData[jmol1]; // Relevant to my page only.
}
Use message call back function to put state info into global variable jmolVar1.
Use a variable - not hidden field. Hidden fields gave me problems -
probably CR/LF issues.
They may be hidden, but they seem to insert platform specific line info:
function processMessage(appNum, messageString, indexNum) {
if (messageString.indexOf("function _setWindowState() {") > -1) {
jmolVar1 = messageString + ""; }
}
Put state info in new Jmol applet:
function pasteMol() {
if (feedbackFlag) { feedback(r[9]); } // Relevant to my page only.
evalRasmol("select *");
evalRasmol(jmolVar1);
}
Best Regards
Otis
--
Otis Rothenberger
http://chemagic.org
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users