Re: [Jmol-users] Jmol .jar vs JmolData.jar: help with getproperty
Dear List, I've spent more time with the excellent online help, and I think I've got the atom selection figured out for my purposes. Chagrined, Matt On 7/5/12 12:36 PM, "Kubasik, Matt" wrote: >Dear list, > >I am seeking guidance on getproperty (and possibly correct atom >expressions) within JmolData.jar. Will >x=getproperty(³atominfo[nnn].xxx²} work in JmolData.jar? > >I would like to use JmolData.jar to process Gaussian output files >containing vibrational vectors of atoms in different vibrational modes. > >The following sequence works fine in Jmol.jar (invoked via terminal¹s >command-line, e.g." java -jar $Jmol -on $freqfile -s $script"), but it >prints an empty string in JmolData.jar: > >framenumber=258 >frame @framenumber >c_index=16 >cvibvector=getproperty("atomInfo["+c_index+"].vibVector") >show cvibvector > >Is it that ³frame² does not work in JmolData.jar? Do I need a rigorous >atom expression (for the 16th atom of the 258th frame) for JmolData.jar? > >As a work-around, the following syntax for getproperty places the >vibvector for EVERY 16th atom of EVERY frame in an array in JmolData.jar: > >c_index=16 >allcvibes=getproperty("atominfo.vibVector",{atomno=c_index}) > >Is there a better way to specify a particular atom of a particular >frame/model in JmolData.jar? > >Matt Kubasik >Department of Chemistry and Biochemistry >Fairfield University > >PS Getproperty "modelinfo" seems to work equally well in either Jmol.jar >or JmolData.jar. E.g., the following works the same in both: >freq=getproperty("modelinfo.models["+framenum+"].modelProperties.Frequency >"); > > >Details: >Jmol Version: 12.3.31 2012-06-16 00:04 >java.vendor: Apple Inc. >java.version: 1.6.0_31 >os.name: Mac OS X >Access: ALL >memory: 11.3/85.0 > > >-- > >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >___ >Jmol-users mailing list >Jmol-users@lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/jmol-users -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Addressing specific commands to one of two applets
3rd try Another way, without changing the newAppletWindow() function in new.js The popup page cannot read variables from the opener page but can execute functins there (as proved by the call to jmolGetPropertyAsString() ) So: 1. set a ***javascript function*** in the mother page that returns a value depending on your choice ("left" or "right" in your example). function whichJmolCalled() { var whichJmol = 'A'; if (document.getElementById('optB').checked) { whichJmol = 'B'; } return whichJmol; } which you should adapt to your case --how you specify which applet (this I did with two radio buttons A and B) 2. modify the JmolPopup.htm source like function getState(){ if (theScript) { return theScript } if (!opener) { alert("The page that opened this pop-up window is not available.") return "" } if (typeof opener.whichJmolCalled == "undefined") { var t = "0"; } else { var t = opener.whichJmolCalled(); } return opener.jmolGetPropertyAsString("stateInfo","", t) } -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Addressing specific commands to one of two applets
2nd try It seems that the popup page cannot read variables from the opener page (at least in my Firefox Win), so I've changed the procedure: 1. set a javascript variable in the mother page which value is set depending on your choice ("left" or "right" in your example). Let's say that variable is called whichJmol 2. change the newAppletWindow() function in new.js to read and use that variable in the link, like var newwin=open("JmolPopup.htm?whichJmol=" + whichJmol,"jmol_"+sm, woptions2) Note I am using the same word for the variable name and the URL parameter; they could be different. 3. modify the JmolPopup.htm source like function getState(){ if (theScript) { return theScript } if (!opener) { alert("The page that opened this pop-up window is not available.") return "" } var t = location.search.split('whichJmol=')[1]; //this is crude, may be done safer return opener.jmolGetPropertyAsString("stateInfo","", t ? t : "0") } Ah, everything is fine here. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Google as an InChI to CAS Resolver for NIST Spectra
those aren't actual links -- that is just Jmol script that is being messed with by your browser. On Thu, Jul 5, 2012 at 11:38 AM, Angel Herráez wrote: > I tried to test Bob's script, and it seems that the space after 80& > must be removed > > x = "http://webbook.nist.gov/cgi/cbook.cgi?Mask=80&"; + script("show > chemical inchi") > > > > > -- > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > ___ > Jmol-users mailing list > Jmol-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jmol-users > -- Robert M. Hanson Larson-Anderson Professor of Chemistry Chair, Chemistry Department St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr 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 -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Addressing specific commands to one of two applets
Nick, For the record, this is achieved trivially using JmolApi.js instead of Jmol.js. 1) There are no defaults -- you specify which applet in all calls. 2) The first parameter of all calls is the applet id -- the full name, not the "extension" There are no extensions, just whatever you call the applet. The way you set up an applet using JmolApi.js is with three commands (recommended -- could all be one): jmolLeft = "jmolLeft" // looks odd, but it allows adding buttons and script calls // prior to the introduction of the applet on the page. Info = {} // all the parameters here -- see JmolApi.js jmolLeft = Jmol.getApplet(jmolLeft, Info) // creates the applet Then all the calls look like this: Jmol.x(jmolLeft,) Note that before the getApplet call, this variable "jmolLeft" is a string; after it is a Jmol._JmolApplet object. If you have more than one applet, you just define more variables: jmolRight = "jmolRight" etc. You can reuse Info or make separate ones. Info can be deleted after the Jmol.getApplet() call if you want. Along with JmolApi.js, you need two other files minimum: JmolCore.js (first) JmolApplet.js JmolApi.js That gets you the full capability of Jmol.js, plus some. All the functions you will ever call, though, are in JmolApi.js JmolPopup2.htm is designed for JmolApi.js. You can either define Jmol._lastAppletID or you can add that to the URL with "?ID=" to specify which applet is the originator. That's at http://chemapps.stolaf.edu/jmol/docs/examples-12/JmolPopup2.htm Bob -- Robert M. Hanson Larson-Anderson Professor of Chemistry Chair, Chemistry Department St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr 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 -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Addressing specific commands to one of two applets
Ok, some suggestions for the popup: The relevant code is in JmolPopup.htm within function getState() It says opener.jmolGetPropertyAsString("stateInfo") jmolGetPropertyAsString() takes a target applet ID as its 3rd parameter, http://jmol.sourceforge.net/jslibrary/index.en.html#jmolGetPropertyAsString so I would 1. set a javascript variable in the mother page which value is set depending on your choice ("left" or "right" in your example). Let's say that variable is called whichJmol 2. modify the JmolPopup.htm source like function getState(){ if (theScript) { return theScript } if (!opener) { alert("The page that opened this pop-up window is not available.") return "" } var t = opener.whichJmol ? opener.whichJmol : "0"; return opener.jmolGetPropertyAsString("stateInfo","", t) } I think that should do it. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Addressing specific commands to one of two applets
Hi Nick While jmolSetTarget() applies to UI controls, jmolScript() specifies its target directly, as the 2nd parameter http://jmol.sourceforge.net/jslibrary/#jmolScript So you would use javascript:jmolScript('load model/miscellaneous/ene_reaction/1-pentene_decomposition.xyz', 'right')" > I also use the JmolPopup.htm method to generate a new window with the > contents of the the > current Jmol applet in place e.g. > http://138.253.125.70/~eleanorvail/externalslim/Main%20Page.html click the > More Controls > button. Would it be possible to make this work with one of two applets at > will? It sure will, but I'm not familiar with the source code of JmolPopup.htm. I will try and have a look. -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Google as an InChI to CAS Resolver for NIST Spectra
I tried to test Bob's script, and it seems that the space after 80& must be removed x = "http://webbook.nist.gov/cgi/cbook.cgi?Mask=80&"; + script("show chemical inchi") -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
[Jmol-users] Jmol .jar vs JmolData.jar: help with getproperty
Dear list, I am seeking guidance on getproperty (and possibly correct atom expressions) within JmolData.jar. Will x=getproperty(“atominfo[nnn].xxx”} work in JmolData.jar? I would like to use JmolData.jar to process Gaussian output files containing vibrational vectors of atoms in different vibrational modes. The following sequence works fine in Jmol.jar (invoked via terminal’s command-line, e.g." java -jar $Jmol -on $freqfile -s $script"), but it prints an empty string in JmolData.jar: framenumber=258 frame @framenumber c_index=16 cvibvector=getproperty("atomInfo["+c_index+"].vibVector") show cvibvector Is it that “frame” does not work in JmolData.jar? Do I need a rigorous atom expression (for the 16th atom of the 258th frame) for JmolData.jar? As a work-around, the following syntax for getproperty places the vibvector for EVERY 16th atom of EVERY frame in an array in JmolData.jar: c_index=16 allcvibes=getproperty("atominfo.vibVector",{atomno=c_index}) Is there a better way to specify a particular atom of a particular frame/model in JmolData.jar? Matt Kubasik Department of Chemistry and Biochemistry Fairfield University PS Getproperty "modelinfo" seems to work equally well in either Jmol.jar or JmolData.jar. E.g., the following works the same in both: freq=getproperty("modelinfo.models["+framenum+"].modelProperties.Frequency"); Details: Jmol Version: 12.3.31 2012-06-16 00:04 java.vendor: Apple Inc. java.version: 1.6.0_31 os.name: Mac OS X Access: ALL memory: 11.3/85.0 -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Google as an InChI to CAS Resolver for NIST Spectra
got blocked because of the image. It's an interesting script. Best with "background white" but also kind of cool with "background black" On Wed, Jul 4, 2012 at 7:26 PM, Robert Hanson wrote: > I must be missing something here... > > > load $caffeine > x = "http://webbook.nist.gov/cgi/cbook.cgi?Mask=80&"; + script("show > chemical inchi") > y = "http://webbook.nist.gov/cgi/cbook.cgi?Spec="; + > load(x).split("Spec=")[2].split('"')[1].replace("amp;","") > background image @y > > At this point y = > http://webbook.nist.gov/cgi/cbook.cgi?Spec=C58082&Index=0&Type=IR > > Right? > > > > -- Robert M. Hanson Larson-Anderson Professor of Chemistry Chair, Chemistry Department St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr 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 -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
[Jmol-users] Fwd: Reminder: IIT System Downtime Friday afternoon, July 6
>From St. Olaf IT... This includes chemapps.stolaf.edu, I believe. -- Forwarded message -- Greetings, This is a reminder that many IIT systems will be unavailable from Friday, July 6, 12:00 noon to Friday, July 6, 6:00 PM while we perform maintenance and upgrades on our servers. During this downtime, - We will have a minimal web presence online -- Robert M. Hanson Larson-Anderson Professor of Chemistry Chair, Chemistry Department St. Olaf College Northfield, MN http://www.stolaf.edu/people/hansonr 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 -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users
Re: [Jmol-users] Google as an InChI to CAS Resolver for NIST Spectra
I must be missing something here... load $caffeine x = "http://webbook.nist.gov/cgi/cbook.cgi?Mask=80&"; + script("show chemical inchi") y = "http://webbook.nist.gov/cgi/cbook.cgi?Spec="; + load(x).split("Spec=")[2].split('"')[1].replace("amp;","") background image @y At this point y = http://webbook.nist.gov/cgi/cbook.cgi?Spec=C58082&Index=0&Type=IR Right? <>-- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users