HowTo: Shutdown your Mac with a text message

Ever went on a trip and thought oh shit I forgot to turn of my Mac? Well you could turn around and go back, you could call a friend or you could just send a text message to your email address that Mail downloads and shut it down yourself. I’ve already showed you how to shutdown windows with a text message and a batch script. Now it’s time to do it Mac style. To complete this tutorial you will need the following.

1. A Mac (duh) Ive only tried this on Leopard, if you get it running on Tiger please let me know.
2. Mail which if you have a Mac you should have installed.
3. ScriptEditor also included with Mac
4. A cellular phone with sms text messaging capabilities and sms service.

Ok to begin you need to have Mail up running and configured to receive emails for an email account of your choice. You may want to setup a hotmail account just for this type of thing e.g. super-secret@hotmail.com to prevent standard emails triggering your rules. I will leave that at your discretion. Once you have Mail setup and receiving email from your super-secret email address the next steps are easy.

You will need to setup a rule to handle you message. So once you have Mail open click on Mail > Preferences in the menu bar [top left of your screen]. Once the dialog box opens click on Rules (shown below).

Click to enlarge

Then click on the Add Rule button (shown below).

Then setup your rule. This part you can set up however you like but I recommend using the following. “If “all” the following conditions are met: then select “From” then “is equal to” then enter your super-secret email address. Shown below.

Click to enlarge

Next download this Shutdown AppleScript file and save it somewhere on your Mac. Under perform the following actions: select Run AppleScript and select the file by clicking choose file and selecting the script in the finder dialog box. Click ok and “DON’T APPLY” unless you want your machine to shutdown. If you click apply now the rule will run if the criteria you set is true so be careful.

Here is the code written in script editor that makes the magic happen. If you downloaded the file above you wont need to make your own but as a reference I have included it anyways.


ignoring application responses
tell application "Finder"
shut down
end tell
end ignoring

Update
If your cellphone doesn’t have email capability then you will need to find your cellphone service providers email extension. Here is an extensive list of the major providers.

Don’t stop there though. You can virtually run any application or command you want with this. The only limitation on this method would be what you can and can’t do with AppleScript. I hope this helps.

Best regards,

Tim Matheson

One Response to “HowTo: Shutdown your Mac with a text message”

  1. […] download a safe shutdown script, and post your own remote-control computing tricks in the comments. HowTo: Shutdown your Mac with a text message [Tim Matheson […]

Leave a Reply