XTension out in the weeds

James Sentman james at sentman.com
Thu Feb 6 14:43:59 EST 2020


Jeffery,

If you can catch it when it’s happened again you can collect some info that will make it easier for me to see what is causing it and fix it.

If you can launch the Activity Monitor, find XTension in the list and highlight it, click the Get Info button for it and finally the “Sample” button at the bottom of that screen and then email me the output I’ll be able to see what it thinks it’s doing. Hopefully that will reveal at least where the problem is if not an immediate solution. 

The most common way for something to hang up the app is an AppleScript talking to a program via a tell block. If you are doing anything with applescript to any other apps at all you should make sure that they are wrapped in a With Timeout block so that if the external app hangs up, or just something goes goofy with the apple event handling it doesn’t just sit there and wait for it forever. Usually a couple of seconds is enough for any external app to finish whatever it’s doing and you can trap the timeout and send yourself a note that something went wrong.

As far as catching it in the meantime with some other app it shouldn’t be that hard to do that. You could create an Applescript Applet with an idle handler in it to run every 5 minutes. A global properly that would hold a date that the idle handler could compare to the current date. A scheduled event in XTension that would tell the Applet to set the global variable to the current date running every 2 or 3 minutes. If the idle handler in the applet found the global date to be more than say 10 minutes behind it would know XTension had hung up and wasn’t updating the value anymore and then you could send an email or whatever else you liked as long as it didn’t need you to tell XTension to do something :)

Be sure to wrap the tell block for the applet inside a timeout block in your xtension script though or it might end up causing more trouble than it fixes. 

The best solution though is to send me that sample so I can figure out what is causing it and actually fix it!


> On Jan 28, 2020, at 4:56 PM, Jeffrey Lomicka <JeffreyLomicka at comcast.net> wrote:
> 
> I'm having a problem where about once a month XTension hangs up, and I don't notice until the spouse says something about the outdoor lights not coming on in the evening, or until I check the XTDB graphs and start to see straight lines.  I'd like to get a quicker notification.
> 
> Does anyone have a simple system to monitor XTension for signs of life, and notify me by e-mail or text if it appears unresponsive?
> 
> (I could build it into the radiation monitor, because inevitably I get an error back for the oasx console command I use to update the radiation levels, but if there's already something out there it might be easier than writing another 100 lines of code, I'd use it.)

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/20200206/4689545d/attachment.html>


More information about the XTensionList mailing list