yes, scriptWait() is exactly what this is for. Please try it. See note I just sent to jmol-users, re:

scriptWait("script","desiredStatusMessages")

messages include:

atomPicked fileLoaded fileLoadError frameChanged
measurePending measureCompleted measurePicked scriptStarted
scriptEcho scriptStatus scriptError scriptMessage
scriptTerminated userAction viewerRefreshed newOrientation


for example,

s = applet.scriptWait("load someFile;olor atoms red","scriptError")

returns to s:

{"jmolStatus": [[[2,"scriptError",0,"script compiler ERROR: command expected : olor atoms red | line#1"]]]}

which is as a JSON string that decodes using

myArray = eval( "(" + s + ")" ).jmolStatus

as

myArray[0][0] = 1   // message number
myArray[0][1] = "scriptError"  // message type
myArray[0][2] = 0 // optional integer data
myArray[0][3] = "script compiler ERROR: command expected : olor atoms red | line#1" //msg

Good idea, Miguel.

prototype jars in http://www.stolaf.edu/people/hansonr/jmol/test/json

Bob




SourceForge.net wrote:

Bugs item #955762, was opened at 2004-05-18 11:50
Message generated for change (Comment added) made by nicove
You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=379133&aid=955762&group_id=23629

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Scripting
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Miguel (michaelthoward)
Assigned to: Miguel (migueljmol)
Summary: script queuing

Initial Comment:


---------------------------- Original Message
---------------------------- Subject: Re:
[Jmol-developers] Jmol goes Strap
From:    "Miguel" <[EMAIL PROTECTED]>
Date:    Tue, May 18, 2004 0:18
To:      [EMAIL PROTECTED]
Cc:      [EMAIL PROTECTED]
--------------------------------------------------------------------------

[snip]

However, I can not send two commands directly  one
after the other. I have to sleep after each command.

The best way to send multiple commands is to just send
a longer script. Commands are separated by newlines (or
semicolons);

longScript = stript1 + "\n" + script2;

Is this intended ? How long should I sleep ?

Hmmm ... I am sure that the current behavior is
probably buggy if you send one script immediately after
another.

Currently, scripts do not queue.
I am not sure exactly what to do about this.
It has been a while since I thought about it ... it
needs some work.

Q: Why do you want to send two scripts, one immediately
after the other?

Q: To solve your immediate problem, can you accomplish
what you need to by concatenating your scripts?


----------------------------------------------------------------------

Comment By: Nicolas (nicove)
Date: 2006-03-18 07:16

Message:
Logged In: YES user_id=1096197

Is the implementation of scriptWait() enough for this need ?

----------------------------------------------------------------------

You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=379133&aid=955762&group_id=23629


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to