Control Your Mac with Twitter

By Dan Hinckley

10 responses. »

Automator_512.jpgHave 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.

Getting Started

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:

  1. 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.
  2.  

  3. 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.
  4.  

  5. Create an Apple Script that will launch the application you just created
  6.  

  7. Setup rules in Mail to execute the created Apple Script when certain new messages or RSS feed updates are received from Twitter.
  8.  

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:

  1. 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
  2.  

  3. Launch Application – Photo Booth
  4.  

  5. 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).
  6.  

  7. Pause – Set this to 7 seconds so that Photo Booth has enough time to take and save the picture
  8.  

  9. Quit Application – Photo Booth
  10.  

  11. 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.
  12.  

  13. 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.
  14.  

  15. Pause – Set this to 3 seconds so Mail can add the photo files to the email message
  16.  

  17. Send Outgoing Messages – Sends the mail and pictures
  18.  

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.

  1. To keep things simple, close your other applications and open Finder to the folder you’ve saved your TwitterPhoto application in
  2.  

  3. Open Script Editor – Fastest Way to find it is through Spotlight
  4.  

  5. Click Record
  6.  

  7. Select TwitterPhoto.app in Finder – You should see Script Editor automatically add text to its window. Click Stop
  8.  

  9. Save the Script
  10.  

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:

  1. In Mail, Click Mail on the menu bar and then Preference
  2.  

  3. Select the Rules Tab and click Add Rule
  4.  

  5. Enter a Name for the rule and then be sure that All conditions must be met for this rule
  6.  

  7. 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)
  8.  

  9. Add the following actions: Run AppleScript [Select the script we created earlier]
  10.  

MailRule.png

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.

Conclusion

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.

About Dan Hinckley
Dan Hinckley is an experienced Mac user who converted to Apple products when they introduced them on Intel Processors. He loves helping others get more out of their devices! Subscribe to Maciverse.com to get the latest from Dan and the Maciverse Team!! Find out more about Dan:

10 Responses so far.

  1. Automator Tip Of The Week: Picture File Conversion

    April 12, 2008 at 6:29 pm

    [...] Conversion Written by Dan on April 12, 2008 – 6:28 pm – We’ve mentioned previously how wonderful the new Automator is and have decided that to feature a weekly workflow that may make some of your tasks [...]

  2. Nate Nead

    May 21, 2008 at 12:24 pm

    Interesting post. This could be beneficial on a number of levels.

  3. pypeemacear

    August 16, 2008 at 6:25 am

    I'm new here, just wanted to say hello and introduce myself.

  4. Dan

    August 16, 2008 at 8:47 am

    Welcome to Maciverse. Let us know how we can assist!

  5. Best of Maciverse: May 08

    November 12, 2008 at 10:08 am

    [...] Control your Mac with Twitter – Twitter.com has really started to gain in popularity. In addition to providing up to date information to your followers about your activities or websites, you can now also control your Mac with twitter messages. [...]

  6. Mathis

    January 19, 2009 at 12:24 pm

    Hey,

    great thing! I just dont really get how i have twitter sending me this email! Thats the only step that i dont really understand! I just dont really want to do the rss solution. Thank you for you answer right away!

    mathis

  7. Dan

    January 19, 2009 at 2:15 pm

    Mathis, Twitter has been changing the way they notify users. Previously, you could receive an email update for all your twitter status changes. This option no longer appears to be available but can still be followed through RSS.

    Setting up RSS in Mail is quick and easy.

  8. Request to Able Mac Developers: « Youse

    August 3, 2009 at 2:46 pm

    [...] to Able Mac Developers: It seems like twitter could be a powerful way for remote controlling your Mac. You can do it now, but you have to create your own applescripts/automator actions, create Mail.app [...]

  9. Screen Sharing That Never Ends

    October 20, 2009 at 7:33 pm

    [...] Devil’s Kitchen recently went through some of the tutorials we’ve offered about how to Control your Mac with Twitter and Screen Sharing. While working through the tutorials they found this interesting view of a Mac [...]

  10. Yerba Mate

    July 27, 2011 at 5:55 pm

    It sounds like a wonder drug but with all the money drug companies make I can’t believe their is an undiscovered herb that really does everything it claims

Leave a Reply

Site powered by Mangoco