question about email and XTension

Chuck xtension4osx at mac.com
Mon Sep 28 23:06:18 EDT 2015


Dee Dee,

I used to check the weather at the house with a script like this.

Start by making a script to tell XTension something that you want to do. I used a rule that if the subject contained “weatherhome” then it would run an Applescript that would give me all the weather information at my home. It would then text it back to me.

You can make up many different scripts based on what you want to do. Just use a keyword to trigger the different scripts.

With this system you can issue commands to your system from any system in the world as long as you can access your email. Set up a special  email just to handle the commands. I use an alias from my iCloud account.

It’s fairly easy to set up. It just takes time and then testing.

Here is an example of a script that used to work. I haven’t run it for a while so it might have changed which Apple does often. This was for the weather at my house.

property unitList : {“your email address at vtext.com”}
property insideTemp : {}
property outsideTemp : {}
property outsideHumidity : {}
property freezerTemp : {}

set insideTemp to («event xtenValu» of "Temp LR") as integer
set outsideTemp to («event xtenValu» of "Temp outside house") as integer
set outsideHumidity to («event xtenValu» of "Humidity outside house") as integer
set freezerTemp to («event xtenValu» of "Temp bsmt freezer.web") as integer
set currentSunrise to time string of («event xtenSunr»)
set currentSunset to time string of («event xtenSuns»)

set daylightHours to (round (((«event xtenSuns») - («event xtenSunr»)) / 3600) rounding down)
set daylightMinutes to (round ((((«event xtenSuns») - («event xtenSunr»)) / 3600) - daylightHours) * 60)
«event xtenlogm» daylightHours
«event xtenlogm» daylightMinutes

--This is a paging routine
repeat with unitName in unitList -- this allowed the event to go to any recipient I put in the list
	set theName to ""
	set theSender to “your emal at your domain”
	--if you want the time string included in the message you could do it like so:
	--include it in the subject:
	set theSubject to "Inside: " & insideTemp & ", Outside: " & outsideTemp & ", Humidity: " & outsideHumidity & ", Freezer : " & freezerTemp & ", Sunrise: " & currentSunrise & ", Sunset: " & currentSunset & ", Daylight: " & daylightHours & " hours " & daylightMinutes & " minutes, " & "Solar: " & (round («event xtenValu» of "Temp solar panel")) & ", Wind: " & (((«event xtenValu» of "Wind speed (average)") as integer) & ", Gust: " & ((«event xtenValu» of "Wind gust (daily max)") as integer))
	--include it in the body:
	set theBody to "" & return & return
	set theAddress1 to unitName
	
	tell application "Mail" -- this sends the event to the pagers
		set newMessage to make new outgoing message with properties {subject:theSubject, content:theBody & return & return}
		tell newMessage
			set visible to true
			set sender to theSender
			make new to recipient at end of to recipients with properties {name:theName, address:theAddress1}
			tell content
			end tell
			send newMessage
		end tell
	end tell
end repeat

Chuck

> On Sep 28, 2015, at 6:07 PM, Dee Dee Sommers <deesquared at mac.com> wrote:
> 
> Dear XTensioneers,
> 
> So I support a remote system that I would like to be able to send email (or any other method) commands to XTension.
> Is that possible?
> 
> Normally, I administer the system remotely, using LogMeIn Pro.  (confession: I have not investigated XTension’s web-based capabilities because there is a lot more than just XTension that we do with that system.)
> 
> We run our main app via XTension.  Occasionally, it would be REALLY handy if I could just shoot an email (or any other command that is even more efficient) to that system: to XTension to trigger one of the scripts.  How difficult would this be?  I want to keep the overhead and outside apps on the remote system to a minimum.  The machine is a monster: 2012-model Mac Pro currently running 40 GB (yes, FORTY, FOURTY, FOUR-ZERO) RAM.  But we have more trouble with that system than any, so if I can minimize problems, that would be good.  ;-)
> 
> Any suggestions?
> Thank you for your help,
> Dee Dee
> 
> _______________________________________________
> XTensionList mailing list
> XTensionList at machomeautomation.com
> http://mail.machomeautomation.com/mailman/listinfo/xtensionlist



More information about the XTensionList mailing list