Execute Script command

James Sentman james at sentman.com
Fri Apr 1 11:58:38 EDT 2016


I sent this a couple of days ago, but Comcast has been having a fight with our list server on and off they aren’t including the proper host name in the helo message or something and the xtension mail server tells them to shove off. And then on the third try it works. I think they’ve got just one SMTP machine misconfigured and if I just wait for the round robin to send me to a different one it works or something silly like that.

In any case I just noticed this bounced and I hadn’t resent it...

> On Mar 29, 2016, at 3:47 PM, Rob Lewis <rob at whidbey.com> wrote:
> 
> I know the manual entry for Execute Script says it works with Global Scripts. Is there any chance that with the recent reworking it can be used to call a handler in a unit script? 
> 
> Currently my Global Script has 
>    execute script (thisScript) in 30
> 
> Could I put a handler in a unit ON script and say
>    execute script (thisScript) handler “thisHandler” in 30
> ?
> 
> (I’m trying to move my PID Controller from a Global Script into a Unit.) 

Alas not. i can’t immediately think of a way to make that happen “officially” that wouldn’t be very confusing.

You could use the doScript command and just pass it as a string, the doScript command does take an “in 30” parameter so something like:

doScript “tell xUnit \”myUnitName\” to doHandlerName( with, any, data)” in 30

but now you’re writing code that writes code and figuring out what is happening later is going to be very difficult. I’m not sure that such a thing will make things simpler as opposed to more complicated.


> 
> On a separate issue, I was wondering if there is any significant CPU overhead in the Get Unit Property and Set Unit Property commands, as opposed to simply using properties in a script. 

Yes, there is more overhead, but it shouldn’t be more than a few microseconds difference ;) Unit Properties have the advantage that they survive recompilation of the script without getting overwritten which is nice.

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/20160401/1273b8f8/attachment.html>


More information about the XTensionList mailing list