From: Robert H. <ha...@st...> - 2011-03-31 16:44:32
|
I think you have to be careful not to call JmolScriptWait from a script that is already running from a callback message. Not sure if that's the case here, but are you sure you need JmolScriptWait? I can't remember what the context is of this. What is invoking this script? Unrelated to this, you can just use atomInBox = {select ((1.1 or 2.1) and within(boundbox))} instead of select ((1.1 or 2.1) and within(boundbox)); define atomInBox selected; That way you have a Jmol variable, not a defined set of atoms. I guess it's a little different. I don't see that JavaScript call working for any browser, unless you for the purposes of Email broke up those lines. In JavaScript you would need to escape the line terminations using "\": jmolScriptWait("\ boundbox {@centerX, @centerY, @centerZ} {@boxSizeX/2 @boxSizeY/2 @boxSizeZ/2};\ if (boundboxFlag==1){boundbox ON; axes DOTTED; axes SCALE 3; }else{axes Off; boundbox off; };\ select ((1.1 or 2.1) and within(boundbox)); define atomInBox selected;\ select ((1.1 or 2.1) and within(group, within(boundbox)))\ "); Bob On Wed, Mar 30, 2011 at 10:49 PM, Yingjie Lin <Yin...@ms...> wrote: > Hi Robert, > > Thanks for your earlier answer. > > So I tried jmolScriptWait(). When jmolScriptWait() is called, Sarai often > becomes irresponsive. > I have experienced this on two different computer, so the problem is > probably not in my machines. > Here's one example of jmolScriptWait() call that makes my Safari > irresponsive. > > jmolScriptWait(" > boundbox {@centerX, @centerY, @centerZ} {@boxSizeX/2 @boxSizeY/2 > @boxSizeZ/2}; > if (boundboxFlag==1){boundbox ON; axes DOTTED; axes SCALE 3; > }else{axes Off; boundbox off; }; > select ((1.1 or 2.1) and within(boundbox)); define atomInBox > selected; > select ((1.1 or 2.1) and within(group, within(boundbox))) > "); > > Though I thought jmolEvaluate was used to get a value from Jmol, I am using > it as a substitute for > jmolScriptWait(). Is there any potential problem with that? > > Thanks. > > Yingjie > > > ------------------------------------------------------------------------------ > Create and publish websites with WebMatrix > Use the most popular FREE web apps or write code yourself; > WebMatrix provides all the features you need to develop and > publish your website. http://p.sf.net/sfu/ms-webmatrix-sf > _______________________________________________ > Jmol-users mailing list > Jmo...@li... > https://lists.sourceforge.net/lists/listinfo/jmol-users > -- Robert M. Hanson Professor of Chemistry St. Olaf College 1520 St. Olaf Ave. Northfield, MN 55057 http://www.stolaf.edu/people/hansonr phone: 507-786-3107 If nature does not answer first what we want, it is better to take what answer we get. -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900 |