I've been checking out Launchbar, thinking replacing my beloved Quicksilver because supposedly it is not being worked on much anymore. While viewing these very helpful Launchbar Video tutorials, I noticed one of them was about Tweeting from Launchbar. For firing off a quick tweet, this is very handy.
However, I had problems getting the script mentioned in the tutorial to work. After some more searching and tweaking, I can came up with this script, which works well enough for me and gives Launchbar credit for the tweet, which makes you look super cool/geeky as most folks will probably be like what the hell is this Launchbar???
To use this script, open up Script Editor and copy it in, Compile and save it into ~/Library/Application Support/LaunchBar/Actions - where Launchbar should pick it up. From there, just use as shown in the video. Note this assumes you have Growl installed - which you should ;)
using terms from application "LaunchBar" on handle_string(tweet) -- Init my growlRegister() set charcount_max to 140 set charcount_tweet to (count characters of tweet) -- Check message length if charcount_tweet ? charcount_max then -- Get credentials for twitter.com tell application "Keychain Scripting" set twitter_key to first Internet key of current keychain whose server is "twitter.com" set twitter_login to quoted form of (account of twitter_key & ":" & password of twitter_key) end tell set twitter_status to quoted form of ("source=launchbarat&status=" & tweet) try -- Send tweet do shell script "curl --user " & twitter_login & " --data-binary " & twitter_status & " http://twitter.com/statuses/update.json" -- Display success message growlNotify("Tweet Sent:", tweet) on error -- Display error message growlNotify("Error Tweeting.", "Try again?") end try else -- Tweet is too long growlNotify("Tweet Too Long", "Tweet is " & charcount_tweet & " characters long. The maximum length is " & charcount_max & " characters.") end if end handle_string end using terms from using terms from application "GrowlHelperApp" -- Register Growl on growlRegister() tell application "GrowlHelperApp" register as application "Tweet" all notifications {"Alert"} default notifications {"Alert"} icon of application "Script Editor.app" end tell end growlRegister -- Notify using Growl on growlNotify(grrTitle, grrDescription) tell application "GrowlHelperApp" notify with name "Alert" title grrTitle description grrDescription application name "Tweet" end tell end growlNotify end using terms from |


By Zettt December 8, 2009 - 2:03 am
Thanks for the mention. Good to have some people taking care of these scripts.
My last version of the Twitter thing uses bit.ly as URL shortener.
Maybe that’s interesting for you:
http://www.zettt.com/launchbar-send-tweets-using-bit-ly-url-shortening/