Skip to content

Instantly share code, notes, and snippets.

@tockrock
Created October 29, 2011 05:43
Show Gist options
  • Save tockrock/1324143 to your computer and use it in GitHub Desktop.
Save tockrock/1324143 to your computer and use it in GitHub Desktop.
AppleScript that tweets from LaunchBar through ttytter, and notifies with growl(growl notify). Based on work by Justin Blanton(@jblanton) http://hypertext.net/2011/05/tweet-via-launchbar
on handle_string(tweet)
if length of tweet ≤ 140 then
set theResult to do shell script "~/bin/ttytter -status=" & quoted form of tweet & " 2>&1"
do shell script "/usr/local/bin/growlnotify -n 'tweet' -m '" & theResult & "' -t 'Success' "
else
set charsOver to (length of tweet) - 140
do shell script "/usr/local/bin/growlnotify -n 'tweet' -m \"You're " & charsOver & " Chars Over\" -t 'fail'"
tell application "LaunchBar"
remain active
end tell
end if
end handle_string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment