Re: [Jmol-users] Backslash Confusion

2010-12-01 Thread Otis Rothenberger
Bob, Thanks again. Your comments that I'm leaving in this response are a good FIND primer for me to keep handy. Otis Otis Rothenberger chemagic.com On 12/2/2010 12:51 AM, Robert Hanson wrote: On Wed, Dec 1, 2010 at 12:09 PM, Otis Rothenberger mailto:osrot...@chemagic.com>> wrote:

Re: [Jmol-users] Backslash Confusion

2010-12-01 Thread Robert Hanson
On Wed, Dec 1, 2010 at 12:09 PM, Otis Rothenberger wrote: > Bob, > > Thanks. That's what I thought, but because of my uncertainty on this > issue, I was having problems interpreting some find results. That statement > may seem strange, but I have it in my head that the following logic is > corre

Re: [Jmol-users] Get the color of a selection

2010-12-01 Thread Robert Hanson
{whatever}.color = {selected}.color On Wed, Dec 1, 2010 at 7:23 PM, Yingjie Lin wrote: > Dear Jmol Users, > > Is there a way for Jmol to know what color a SELECTION is, so that the same > color could be assigned some other SELECTIONs ? > > Something like > getColor Selection_A color_A; > color

[Jmol-users] Get the color of a selection

2010-12-01 Thread Yingjie Lin
Dear Jmol Users, Is there a way for Jmol to know what color a SELECTION is, so that the same color could be assigned some other SELECTIONs ? Something like getColor Selection_A color_A; color (Selection_B) color_A; Thank you. - Yingjie - Yingjie --

Re: [Jmol-users] Backslash Confusion

2010-12-01 Thread Otis Rothenberger
Bob, Thanks. That's what I thought, but because of my uncertainty on this issue, I was having problems interpreting some find results. That statement may seem strange, but I have it in my head that the following logic is correct: {*}.find("smiles","SOMESMILES") will evaluate true if SOMESMI

Re: [Jmol-users] Backslash Confusion

2010-12-01 Thread Robert Hanson
Yes, quite a pain. You'll need in that case: JavaScript "C(=C\\C)/C" gets translated to C(=\C)/C which is OK for JavaScript but will be translated again by Jmol to . So you want C: var jsX = "C(=CC)/C" First escape becomes: C(=\\C)/C which is then properly translated by Jmol

[Jmol-users] Backslash Confusion

2010-12-01 Thread Otis Rothenberger
Bob, I'm still confused on the use of backslash with find. Here's the scenario: sm2 is defined in a jmolScript: "var sm2 = '" + smileJs1 + "';" where smilesJs1 is JavaScript string defined as "C(=C\\C)/C" I want to do a: {*}.find('SMILES',sm2) Should my JmolScript string construction be as a

Re: [Jmol-users] JmolButton click counter?

2010-12-01 Thread Rolf Huehne
On 12/01/2010 05:56 AM, Yingjie Lin wrote: > Dear Jmol Users, > > I would like to be able to count the number of times a jmolbutton has been > clicked by a user, and then > to make this button do three different things upon the 1st, 2nd and 3rd > clicks. > > To be more specific, I would like to

Re: [Jmol-users] JmolButton click counter?

2010-12-01 Thread Angel Herráez
Hi Yingjie Mike's solution seems the best thing you can do. It basically means that instead of using jmolButton() you use your own input type=button with jmolScript(). That way you have more control --or easier at least. You could probably still use jmolButton() giving it the ID parameter and