Thanks to Karl and Matt letting me know about Twurl, my AppleScriptTweet script now works with OAuth authentication. Here’s how to get it working for yourself…
1. Download the updated script: http://jimmitchell.org/files/AppleScriptTweet.zip
2. Use the Terminal.app (/Applications/Utilities/) to install the “twurl” rubygem – a Twitter-friendly version of curl:
$ sudo gem install twurl
3. Create a new application at dev.twitter.com to obtain an API key. After logging into Twitter with the account you want to use AppleScriptTweet with, go to http://dev.twitter.com/apps/new, and fill out the form:
- Application Name: Anything (but must be unique, may take an attempt or two)
- Description: AppleScriptTweet – tweet from AppleScript (or add your own description)
- Application Website: http://jimmitchell.org/projects/applescripttweet/
- Organization: http://jimmitchell.org/
- Application Type: Client
- Default Access type: Read & Write
4. Accept the Terms & Conditions, and copy down the “consumer key” and “consumer secret” that appear on the next page.
5. Go to the twurl github webpage and follow the instructions for authenticating in Terminal: http://github.com/marcel/twurl/
6. Change the property values in the AppleScriptTweet script with AppleScript Editor:
- property theAccount : “YourTwitterAccount” — this is the Twitter account you created the app for in step #2
- property theApp : “YourApplicationName” — this is the application name you used in step #2
Save the script and that’s it. You should be good to go now.
Note: I cannot (and won’t) answer support questions regarding the use of twurl. It’s not my code, so I can’t do anything if it breaks your system. The one thing I can shed some light on is that the “twurl authenticate…” command in the Terminal should be entered all on one line.
Any questions about AppleScriptTweet should be posted in the comments here.