This is absolutely sweet!
Would be just perfect if the growlification could go the other way around, I mean notifying of new incoming twitters… but probably that’s something for twitterific more than for Tweet.scpt
I love Quicksilver, but the one problem with using it to update Twitter was that you couldn’t tell if your tweet was too long. Word/letter/line counting is a simple but useful function that I couldn’t find anywhere else in Quicksilver, so I wrote my own AppleScript action for it (I borrowed your code for Growl notifications). Anyone who wants to add such functionality to Quicksilver can get the script from my post on the Quicksilver forums here:
I hope people find this useful. Previously I’d echo my tweet through a pipe to wc and run as a shell command. This action is a big improvement I activate Quicksilver, press period to enter my text, then tab, then WC to select my Word Count action, enter, then (assuming it’s not too long) press tab and TW to select the Tweet action and press enter.
Now Quicksilver is my favourite way to update Twitter too!
Now Quicksilver provides my favourite way to update Twitter.
I modified your Growlified Tweet script to check the message length before sending it off to Twitter. Maybe some of you might be interested:
using terms from application "Quicksilver"
on process text 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 ("status=" & tweet)
try
-- Send tweet
do shell script "curl --user " & twitter_login & " -F " & twitter_status & " http://twitter.com/statuses/update.json”
– Display success message
growlNotify(”Tweet Sent”, tweet)
on error
– Display error message
growlNotify(”Error Sending Tweet”, “There was an error sending your Tweet.”)
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 process text
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
This is so frickin’ sweet. Thanks!
Works wonderfully.
Thanks!
This is absolutely sweet!
Would be just perfect if the growlification could go the other way around, I mean notifying of new incoming twitters… but probably that’s something for twitterific more than for Tweet.scpt
Anyway, again thanks for the good stuff!
Big up!
Thanks for the great script.
I just edited the script so it pushes the update to your iChat Status Message.
You can see it here.
sweet!
Thanks a million for this Ted.
I love Quicksilver, but the one problem with using it to update Twitter was that you couldn’t tell if your tweet was too long. Word/letter/line counting is a simple but useful function that I couldn’t find anywhere else in Quicksilver, so I wrote my own AppleScript action for it (I borrowed your code for Growl notifications). Anyone who wants to add such functionality to Quicksilver can get the script from my post on the Quicksilver forums here:
http://blacktree.cocoaforge.com/forums/viewtopic.php?t=5436
I hope people find this useful. Previously I’d echo my tweet through a pipe to wc and run as a shell command. This action is a big improvement
I activate Quicksilver, press period to enter my text, then tab, then WC to select my Word Count action, enter, then (assuming it’s not too long) press tab and TW to select the Tweet action and press enter.
Now Quicksilver is my favourite way to update Twitter too!
Now Quicksilver provides my favourite way to update Twitter.
I think I’m in love.
I modified your Growlified Tweet script to check the message length before sending it off to Twitter. Maybe some of you might be interested:
using terms from application "Quicksilver"on process text 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 ("status=" & tweet)
try
-- Send tweet
do shell script "curl --user " & twitter_login & " -F " & twitter_status & " http://twitter.com/statuses/update.json”
– Display success message
growlNotify(”Tweet Sent”, tweet)
on error
– Display error message
growlNotify(”Error Sending Tweet”, “There was an error sending your Tweet.”)
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 process text
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
I modified your Growlified Tweet script to check the message length before sending it off to Twitter. Maybe some of you might be interested: http://www.breun.nl/2007/04/growlified_tweet_deluxe.html