Thanks, Angel. The comment line for mol files is the third line. Put 
"#jmolscript:" there.

That was a compiler bug in 11.1 (only, not 11.0) that disabled all 
embedded script commands in any sort of file.
It's fixed. Had to do with my implementing the new

x = 3

format as an alternative to

set x 3

The command

allowEmbeddedScripts = false

is now being added to whatever script you use so that there is less 
possibility of an endless loop.

I guess you could override it with

allowEmbeddedScripts = true;

at the beginning of your script if the script itself loads a  file, and 
that file has an embedded script you want to run. Actually, there might 
be a use for this -- You've changed the data file to a different file, 
but for some reason you have to have the original file name used -- 
using "load xxxx.mol" embedded in that file would work like an HTML 
redirect in that case. 

The use I had in mind was the guaranteed loading of a given set of unit 
cells. You can embed the following:

#jmolscript: load "" {2 2 2}

and the user will ALWAYS get that set of unit cells (and whatever other 
parameters you might choose). A bit dictatorial, but there may be a use 
for it. Without "allowEmbeddedScripts = false", of course, each load 
would load the file again, and Java would have a fit.

 Or, with the new IF command capability, you could make it a bit nicer:

#jmolscript: if {symop=1}= 0;load "" {1 1 1}

That is, "if the user loaded this file without any unit cell 
designation, so therefore there are are no symmetry operators defined, 
then load it again with a full unit cell." Of course, you would only 
allow that in a cif file!

Bob







Bob


Angel Herraez wrote:

>I posted in Nov. about using #jmolscript within XYZ files, and Bob 
>fixed the problem.
>
>Now I am having trouble using MOL files with the embedded
>#jmolscript   commands
>(maybe I didn't test MOL in Nov, don't remember)
>
>If I put #jmolscript on line nr.2, as advised:
>
>- unless the line starts with a space, Jmol  throws an error:
>
>script compiler ERROR: command expected: (contentsOfLine1)
>#jmolscript: : (contentsOfLine1)
>(path/file).mol line#1
>script ERROR: ScriptException:error loading a script -> command 
>expected: (contentsOfLine1)
>#jmolscript: : (contentsOfLine1)
>(path/file).mol line#1
>    Script line:script "(path/file).mol"
>           File:(path/file).mol Line number:1
>
>
>- if the line starts with a space before #jmolscript, no error, but 
>the script is not applied
>
>(This is for both app and applet, 11.0.RC4; similar situation in 
>11.1.6, although different error message)
>
>The XYZ files work OK with #jmolscript on line nr.2.
>
>Is this a bug, or am I doing sth wrong?
>Thanks
>
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys - and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>Jmol-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/jmol-users
>  
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to