Murphy Mac - Screencasts and Tutorials » Archive of 'Aug, 2013'

If This Than That For AppleScript Kickoff

For a long time I’ve used scripts that were kicked off by incoming mail on my Mac.  As long as the mail was from me and the subject matched a keyword the script would run.  There are plenty of tools enabling remote control of your Mac.  But for some things I still find it easier to kick off a script than to manually take control of the Mac.  SSH takes longer, and so do remote desktop apps.

There were some problems with the Mail.app scripts.  Sometimes Mail wasn’t running.  Sometimes they didn’t kick off for some unknown reason.  When things don’t work every time you tend to stop relying on them.

I’ve got a new way to kick off scripts by sending a text message to If This Than That.   IFTTT receives my message and writes a text file to my Dropbox account named after the message content.   My Mac sees the file and a Folder Action script runs, performing whatever task I requested.

There are a couple I use frequently:

  • Mute my Mac
  • Launch iTunes
  • Reboot my Mac
  • Kill and restart EyeTV
  • Turn on Require Password in System Preferences

I’ve assigned a one letter code to each of those things.  When I send the letter in a text to IFTTT I’m done.  My Mac goes silent or iTunes launches for my Apple TV or whatever it is I need happens.  Less steps than SSH or some kind of remote desktop.

My mind is starting to go so it’s hard to remember which letter does what.  Every once in a while I text #m to IFTTT and they text me back a canned text message I prepared with the key to my commands.  Their reply to #m looks something like this:

a. mute b. iTunes c. restart EyeTV

The thing I don’t like about this method is giving IFTTT access to my Dropbox account. Not that I have an issue with them specifically. I’m just hoping that the protocols to allow interaction between various online services become more granular so you don’t have to grant so much access for whatever you want to do.

I’ll post some more information over the next few days detailing the AppleScripts themselves.

 

| Permalink