Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-15 Thread Roberto Mosca
Thanks Robert, but how to you retrieve it then programmatically? The instruction Jmol.evaluate(jmolApplet, print {atomNo= + atomNo + }.label); does not work. Let me know. Best, Roberto On Wed, Jan 15, 2014 at 6:58 AM, Robert Hanson hans...@stolaf.edu wrote: atom properties are numbers,

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-15 Thread Rolf Huehne
On 01/15/2014 09:49 AM, Roberto Mosca wrote: Thanks Robert, but how to you retrieve it then programmatically? The instruction Jmol.evaluate(jmolApplet, print {atomNo= + atomNo + }.label); does not work. I wasn't aware of it but it seems that you need 'script(your_jmol_script_commands)'

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-15 Thread Roberto Mosca
Hi Rolf, that is great! It works for me to!! I wouldn't mind if they write it somewhere in the wiki, though... (at least, I could not find even after a thorough search). Many thanks for your help, this really solved my issue! Best, Roberto On Wed, Jan 15, 2014 at 11:24 AM, Rolf Huehne

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-15 Thread Angel Herráez
Hello Roberto that is great! It works for me to!! I wouldn't mind if they write it somewhere in the wiki, though... (at least, I could not find even after a thorough search). YOU can write it in the Wiki, just sign up as user and edit whatever page you feel is adequate. Maybe Recycling

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-15 Thread Robert Hanson
You are almost there. drop the PRINT command part: Jmol.evaluate(jmolApplet, {atomNo= + atomNo + }.label); or Jmol.evaluate(jmolApplet, @ + atomNo + .label); Note that you can use label() or label(..some format stuff here...) Bob On Wed, Jan 15, 2014 at 3:49 AM, Roberto Mosca

[Jmol-users] How to retrieve the label of an atom programmatically

2014-01-14 Thread Roberto Mosca
Dear all, I am new to Jmol and I have a problem I could not fix by reading the Jmol documentation. I have a JSmol pane in my web page and I set a callback function for pick, which is called pickResidue: function pickResidue(jmolObj,msg,atomNo) { var atomIndex = atomNo+1; var atomInfo =

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-14 Thread Rolf Huehne
On 01/14/2014 04:11 PM, Roberto Mosca wrote: Dear all, I am new to Jmol and I have a problem I could not fix by reading the Jmol documentation. I have a JSmol pane in my web page and I set a callback function for pick, which is called pickResidue: function

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-14 Thread Alexander Rose
Hi, The question is: how can I retrieve the label of the atom that was clicked? I set such label in a Jmol script using the set hoverLabel command and I would like to read it back in the pickResidue function to decide what to do (visualize some information or not). If this is not

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-14 Thread Angel Herráez
In addition to what has been said, I'm afraid that hoverLabel is not the same as label. So retrieving it may need a change or be impossible. Well, it should not be impossible since all atom properties are stored there. Just find out with property you need to invoke and parse.

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-14 Thread Roberto Mosca
Dear Alexander and Rolf, thanks for your help! I tried the instruction Jmol.evaluate(jmolApplet, print {atomNo= + atomNo + }.property_pp); in the following code: function pickResidue(jmolObj,msg,atomNo) { var pp = Jmol.evaluate(jmolApplet, print {atomNo= + atomNo + }.property_pp); }

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-14 Thread Roberto Mosca
For the label and hoverLabel I cannot find any property that contains those two variables... atomInfo, for example, does not contain them... On Tue, Jan 14, 2014 at 5:32 PM, Alexander Rose alexander.r...@weirdbyte.de wrote: Hi, The question is: how can I retrieve the label of the atom

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-14 Thread Rolf Huehne
On 01/14/2014 06:14 PM, Roberto Mosca wrote: Dear Alexander and Rolf, thanks for your help! I tried the instruction Jmol.evaluate(jmolApplet, print {atomNo= + atomNo + }.property_pp); in the following code: function pickResidue(jmolObj,msg,atomNo) { var pp =

Re: [Jmol-users] How to retrieve the label of an atom programmatically

2014-01-14 Thread Robert Hanson
atom properties are numbers, not strings. You will have to set the atom label instead of a property if you want a string. On Tue, Jan 14, 2014 at 1:19 PM, Rolf Huehne rhue...@fli-leibniz.de wrote: On 01/14/2014 06:14 PM, Roberto Mosca wrote: Dear Alexander and Rolf, thanks for your help!