Have you ever been in a meeting and realized that you had forgotten to bring the latest version of a file with you, been out on the town when you remembered you’d left your computer on and the power bill has just been unbearable lately, or forgotten when your mother-in-laws birthday was and needed to know fast?
Never fear, Now you can use Twitter to have your mac send you the important file, turn off your computer to keep your power bill low, and send your phone the date of your Mother in Law’s birthday.
With some initial setup you can have your Mac ready to provide you with the information you need while away from the computer and on the go. To get started we’ll need a Twitter account.
Twitter is a social networking site that provides:
A service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing?
Twitter allows users to post short messages on the web, through email, or with SMS txt messages that will be delivered to their friends via email, txt messages, or rss feeds.
Additionally, twitter’s communication network will allow you to send instructions to your Mac.
To be able to control your Mac with Twitter you’ll need to follow these steps:
- Setup an account at twitter.com. Follow the onscreen instructions and be sure to enter the email address you have setup with Mail on your Mac.
- Create preset tasks in Automator that can perform actions that you may need your Mac to do when you’re away from your computer. Save the Automator actions as an app.
- Create an Apple Script that will launch the application you just created
- Setup rules in Mail to execute the created Apple Script when certain new messages or RSS feed updates are received from Twitter.
To help make this process easier for you to setup on your own Mac, I’ll walk the process to control your Mac with Twitter and use a fun automator task that takes a picture using Photo Booth and sends it in an email.
Creating a Task in Automator: Take a Picture
Before you create a task in Automator be sure that you’ve setup your Twitter account. Next open Automator from your Applications folder and add these steps to your workflow to tell your Mac to take a picture and send it to your email address:
- Hide All Applications – This will hide any open application on your system and make sure no open windows distract from the rest of the workflow
- Launch Application – Photo Booth
- Watch Me Do – The best way to add this part of the workflow is to open Photo Booth, click the Record button in Automator, select Photo Booth and then press the keyboard shortcut that will have Photo Booth take a picture (command + T).
- Pause – Set this to 7 seconds so that Photo Booth has enough time to take and save the picture
- Quit Application – Photo Booth
- Find Finder Items – Set the Where to Pictures, the Whose should include Kind (is Image), date created (is today), extension (is equal to jpg), and name (contains Photo). These filters will tell Automator to find the all the photo booth pictures taken that day including the one just taken.
- New Mail Message – be sure to add the email address you’d like the pictures sent to, the subject and anything in the message you’d like to include.
- Pause – Set this to 3 seconds so Mail can add the photo files to the email message
- Send Outgoing Messages – Sends the mail and pictures
You can test the workflow to ensure that its working properly by clicking the Run option in Automator. This should email out the photos its just taken in Photo Booth.
Now that we have created the workflow we’d like our Mac to follow we need to save it as an application so that it can be executed in the future. I personally have created a folder in Applications directory that I store my automated applications in and saved this app as TwitterPhoto.app.
Creating A Script to Launch an Application
With the application created and saved the next item we need to setup is the Apple Script that will launch the application. If you’ve never created an Apple Script before don’t worry, this will be the easiest script you’ve ever created.
- To keep things simple, close your other applications and open Finder to the folder you’ve saved your TwitterPhoto application in
- Open Script Editor – Fastest Way to find it is through Spotlight
- Click Record
- Select TwitterPhoto.app in Finder – You should see Script Editor automatically add text to its window. Click Stop
- Save the Script
Congrats, you’ve just created a script that will launch the application we just created in Automator. But there is still some work to do before we can test out Twitter’s control over our Mac.
Setting up Mail Rules
The last aspect of setting up your Mac so that you can control it through twitter is configuring Mail. Once you have Mail opened you can either use email messages from Twitter to tell your Mac to execute tasks, or you can add your twitter RSS feed to your Mail application.
With Mail setup to receive information from Twitter, you’re ready to establish Rules in Mail that will launch your TwitterPhoto script and thus your application.
To setup a Rule that will execute a script when a certain command is sent from Twitter to Mail:
- In Mail, Click Mail on the menu bar and then Preference
- Select the Rules Tab and click Add Rule
- Enter a Name for the rule and then be sure that All conditions must be met for this rule
- Add the following conditions: Message Content Contains – Twitter; Message Content Contains – Take Picture; Message Type is RSS (Select Mail if you’re going to use the Mail Messages from Twitter); From Contains [enter twitter delivery email address here] (This is only needed if you are using Mail instead of RSS)
- Add the following actions: Run AppleScript [Select the script we created earlier]
Click Ok and apply the rule. The Message Contents of “Twitter” and “Take Picture” in the rule are the key words that we’re telling your Mac to look for.
When we send those words through Twitter it will know to run the script that will take the picture of the person at the desk and send it in an email.
Control Your Mac With Twitter
Now that your Mac is setup to receive instructions from Twitter you should be ready to send your first instruction. Either from Twitter.com or if you’ve already setup your cell phone with Twitter, send a message that includes the following text, “Twitter Take Picture”.
Once the message is sent through twitter you will receive an email that should trigger the rule we created and cause your Mac to take a picture using Photo Booth. If you setup the rule with RSS feed you may need to manually update the feed for it to get the new instruction.
If all has gone well, you will have an email with a picture of you looking amazed at the power of your Mac and the convenience using Twitter may bring to your life.
You can follow these same steps but customize the Automator workflow to instruct your Mac on different actions you’d like it to run while you’re away.
Be sure to create a separate script and a rule for each process you’d like your Mac to run when it receives instructions from you via Twitter.
What Automator tasks will you create to use with Twitter?
If you enjoy this article please subscribe to our RSS feed to receive additional hints, tips, and insights on how to get the most out of your Mac.