[Jmol-users] Jmol.script() not returning

2014-01-13 Thread Jaime Prilusky
We used to have a call to javascript as part of the script text, but that is not longer working: Jmol.script(jmol0,'load data/123.pdb; javascript alert(“Back”);’); On the following example, the alert() happens before the script gets executed. The threading mechanism plays here against us.

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Robert Hanson
It's not that the alert is coming first; it's that there is no REFRESH before the alert. If you had that command prior to the javascript command, then the structure will appear before the alert. I would argue that this is proper behavior. There is no particular reason to demand an automatic

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Angel Herráez
I agree that the use of refresh is often needed; that's my experience, in many occasions it's been key. However, the doc says otherwise: http://chemapps.stolaf.edu/jmol/docs/#refresh (Unnecessary, and thus deprecated.) I would remove that phrase, Bob :)

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Jaime Prilusky
Dear Bob, Can you please give me an example on how to call a javascript function after the Jmol.script() is done? Thank you in advance, Jaim On Jan 13, 2014, at 1:55 PM, Robert Hanson hans...@stolaf.edumailto:hans...@stolaf.edu wrote: It's not that the alert is coming first; it's that there is

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Jaime Prilusky
Even if adding refresh to Jmol.script, the alert happens before the model gets loaded: Jmol.script(jmol0,'load data/123.pdb; select all; color blue; refresh;'); alert(“Back”); Jaim On Jan 13, 2014, at 2:03 PM, Angel Herráez angel.herr...@uah.es wrote: I agree that the use of refresh is often

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Otis Rothenberger
I use the javascript command frequently. From past experience, arguments in functions can cause issues. At a minimum, I would put quotes around the javascript itself. I think this has to be rigged so that these are double quotes - i.e. javascript alert('Hey there!') This means changing your

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Jaime Prilusky
Have you tried it on 14.0.5 with HTML5? Jaim On Jan 13, 2014, at 2:26 PM, Otis Rothenberger osrot...@chemagic.commailto:osrot...@chemagic.com wrote: I use the javascript command frequently. From past experience, arguments in functions can cause issues. At a minimum, I would put quotes around

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Rolf Huehne
On 01/13/2014 01:21 PM, Jaime Prilusky wrote: Even if adding refresh to Jmol.script, the alert happens before the model gets loaded: Jmol.script(jmol0,'load data/123.pdb; select all; color blue; refresh;'); alert(“Back”); If you take the 'alert' out of the 'Jmol.script' command set it is

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Otis Rothenberger
I'm using 14.0.2. I can check out 14.0.5 later this morning. I should have mentioned in the previous note that the function without an argument no longer needs the quotes around the javascript. The javascript command has been fussy for me for years. Keeping quotes out of the javascript itself

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Otis Rothenberger
Jaim, Quick test on your side: Does alert(1234) work. No quotes - just alert(1234)? Otis -- Otis Rothenberger o...@chemagic.com http://chemagic.com On Jan 13, 2014, at 7:49 AM, Otis Rothenberger osrot...@chemagic.com wrote: I'm using 14.0.2. I can check out 14.0.5 later this morning. I

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Robert Hanson
so noted. Changing that to: refresh * Forces a screen repaint during script execution. Usually unnecessary, this command is useful during selected looping operations or in conjunction with such commands as javascript that otherwise might not initiate a screen repaint. Refreshing is automatically

Re: [Jmol-users] Jmol.script() not returning

2014-01-13 Thread Robert Hanson
That's right, too. In this case you are putting a script into the queue and then immediately and independently firing the alert message. Your initial way is correct; just add a REFRESH command prior to that if you want the model to be displayed during the alert. On Mon, Jan 13, 2014 at 6:21 AM,