Can't do XTDB queries from xTension?

Jeffrey Lomicka JeffreyLomicka at comcast.net
Mon Sep 5 08:19:25 EDT 2022


I updated to the latest xTension yesterday after waiting several years 
(in order to get the latest Kasa plug-in), and it went smoother than I 
expected.  The only broken thing so far is my script for reporting 
rainfall, because queries to XTDB seem to have stopped working.

Note that (at first) I didn't update XTDB, only XTension, so XTDB didn't 
change.  As part of my diagnostics, I did upgrade XTDB as well, but no 
change in behavior.

The script in question is reduced to this:

set unitName to "New Rain Gauge-Total"
set endTime to current date
set startTime to endTime - 24 * 60 * minutes
set newEndTime to startTime + 3 * minutes
tell application "XTdb"
     set queryResult to query unitName starting at startTime ending at 
newEndTime
end tell
write log result

This works flawlessly from the script editor, but when run inside 
XTension it hangs until the Apple event times out or I exit XTDB.

This is running MacOS Sierra.  XTension 9.4.47.

I'm working on a workaround to perform the query in another thread with 
a shell command "osascript -e", that's looking promising.



More information about the XTensionList mailing list