Script executing itself?
James Sentman
james at sentman.com
Sat Mar 12 17:50:48 EST 2016
Help me to picture what you mean exactly?
The do script text that you pass is just text, it’s not a global script or anything else, you can do anything with it that you could do from the command line. But you can’t reference the same script again or any such thing. It’s a fleeting but of one time compiled code.
If you mean could you execute that command from within another global script and have it call back into that global script via the mechanism then yes, you can do that. With the caveat that you can’t pass complicated javascript objects or structures that you couldn’t create in simple text form to pass into it.
The other option is to use a unit property or an attachments script global to hold the current parameter set and instead of taking the parameters from the handler call, have the handler get the parameters it needs from the unit properties or global. That would work better if it was a complicated structure. It also has the added debugging benefit that you can see exactly what the parameters are at any given moment rather than lose them inside the doScript verb where you can’t see what it was that actually ran.
> On Mar 12, 2016, at 4:44 PM, Rob Lewis <rob at whidbey.com> wrote:
>
> I presume that the “doScript” option would allow a script to tell itself to do something at a later time? (Couldn’t find this verb in the docs)
>
Thanks,
James
James Sentman http://www.PlanetaryGear.org http://MacHomeAutomation.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20160312/1d7a312e/attachment.html>
More information about the XTensionList
mailing list