I hate leaving for work in the morning and seeing this
As someone that has been dabbling in AutoHotKey for years I have scripts lying around that run on schedules that I don’t remember writing. Some of them I’ve totally forgotten about until they contact me. My “Snow SMS Alert” is one of those sleeper scripts. I wrote this years ago to wake me up early before work if I needed to go clean snow off my car.
Basically it works like this:
Windows Task Scheduler runs the script 30 minutes before I usually wake up for work.
The script pulls down the API feed from Weather Underground and searches for “snow” in a particular location.
If it looks like it’s snowing sendEmail.exe is used to send an SMS to my phone.
You can easily send SMS messages over email using this formatting:
Alltel [10-digit phone number]@message.alltel.com
AT&T [10-digit phone number]@txt.att.net
Boost Mobile [10-digit phone number]@myboostmobile.com
Nextel [10-digit telephone number]@messaging.nextel.com
Sprint [10-digit phone number]@messaging.sprintpcs.com
T-Mobile [10-digit phone number]@tmomail.net
US Cellular [10-digit phone number]email.uscc.net (SMS)
Verizon [10-digit phone number]@vtext.com
Virgin Mobile USA [10-digit phone number]@vmobl.com
Makes sure SendMail.exe is in the same directory as the AHK script for this to work. With any luck you’ll be greeted with a handy SMS warning before you get out to your car.
Snow SMS Alert
When scheduled through Windows "Scheduled Tasks" this script will send an SMS to
your phone to get you up early enough to clean off your car.
; Set variables here
location = ORD ; Your closet airport code or zipcode
phonenumber = firstname.lastname@example.org ; phone number in email format
smtpserver = mail.isp.com ; outgoing SMTP server
returnemail = email@example.com ; return address for message
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
URLDownloadToFile, http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=%location%, temp
FileRead, Contents, temp
StringSplit, bib, A_LoopField, < If RegExMatch(bib2,"weather>",SubPat)
StringTrimLeft, bib2, bib2, 8
if bib2 contains snow, Snow
Run sendEmail.exe -s %smtpserver% -t %phonenumber% -f %returnemail% -u "It's snowing..." -m Go clean your car off.