Twitter from QuickSilver on Panther solved – avoid keychain scripting

Phew. Finally I’ve made it through and (having re-learned a few things on the way) can now Tweet (is that the verb to use in this case?) from QuickSilver.

You may remember, from last time, that the principal stumbling block was Apple’s Keychain Scripting application – which frankly is unusable for those of us with more than a few items in our keychains.

The Textmate blog then put us on the trail of Apple’s command line tool for maniplulating the keychain. Further investigations turned up a recent posting from Extra Pepperoni on the topic, with a very informative first comment that is a must read. That comment then pointed to an Apple mailing list, CDSA (Common Data Security Architecture.)

So what, exactly, is the solution? Well at the moment it is a bit on the hardcoded hack side of things, but it does work for me. The calls to the app “Keychain Scripting” are replaced by a shell script :

#!/bin/bash
security -q find-internet-password -gs twitter.com 2>&1 | grep password | \
  sed -e "s/password: \"//" -e "s/\"//"

Save that into a text file, perhaps in ~/bin (which you’ll probably have to create.) I chose to call it ‘twitpass.’ Remember to set it to executable …

chmod 755 twitpass

will do the job nicely. Now you can call that script from the AppleScript to get your pasword. Unfortunately I still can’t seem to parse the bulk of the output from security, so you’ll have to hard code your account name or email address into the AppleScript, replacing the tell application “Keychain Scripting” block with something like this:

set twitter_key_account to “user@domain.com”
set twitter_key_pass to do shell script “~/bin/twitpass”
set twitter_login to quoted form of (twitter_key_account & “:” & twitter_key_pass)

So using the above components in the mix of yesterday’s solution and you can Tweet to your heart’s content, without leaving the application you’re working on.

4 Responses to Twitter from QuickSilver on Panther solved – avoid keychain scripting

  1. You rule. It wasn’t working for me with the original script. But your hacks, with a simple modification on my end, made it work. I’m no applescripter so I had to trust everybody’s code would work. But that Keychain stuff was getting in the way. Thanks!

  2. […] Rubygems on your Mac. I couldn’t make it happen. I’m not that serious. Then I found another way to avoid Keychain scripting, but it was still too geeky for me to get working with my limited […]

  3. […] Rubygems on your Mac. I couldn’t make it happen. I’m not that serious. Then I found another way to avoid Keychain scripting, but it was still too geeky for me to get working with my limited […]

Leave a comment