Adium + Quicksilver Script

For whatever reason (perhaps it’s the slowness of Twitterific, or the lack of any other application to satisfy my Twitter-craving) I wanted to be able to Tweet from Quicksilver. A quick Google led me to an AppleScript to Tweet from Quicksilver, but alas…it was a year old and not functional.

So, two hours later – allow me to present an updated version of the script:

using terms from application "Quicksilver"
	on process text im_text
		repeat with im_delimiter_position from 1 to (length of im_text)
			if character im_delimiter_position of im_text = ":" then exit repeat
		end repeat
		set im_contact_name to characters 1 thru (im_delimiter_position - 1) of im_text as string
		set im_message to characters (im_delimiter_position + 2) thru (length of im_text) of im_text as string
		tell application "Adium"

			set user to first contact whose (status type is available and display name starts with im_contact_name)

			if not (exists (chats whose contacts contains user)) then
				tell account of user to (make new chat with contacts {user} with new chat window)
			end if

			send (first chat whose contacts contains user) message im_message
		end tell
		return nothing
	end process text
end using terms from

The procedures for installation and usage are the same.

  • Paste the script into Script Editor and save it in ~/Library/Application Support/Quicksilver/Actions as Send As IM.scpt.
  • Cmd+Space, period, “Contact name: Message”, tab, S, enter.

I now return you to your regular Twedule.

Continue reading » · Written on: 01-12-08 · 25 Comments »

25 Responses to “Adium + Quicksilver Script”

  1. Michael Ramm wrote:

    Damon, Works like a DREAM as we have tested on twitter [michaelramm]. Thanks for the work to make QS an even bigger part of my Mac usage.

    January 12th, 2008 at 9:50 pm
  2. Victor wrote:

    Apparently, after trying both, when compiling the script, it shows a syntax error, where in this line
    “set user to first contact whose (status type is available and (display name starts with im_contact_name or title starts with im_contact_name))”
    contacts is not a valid class.
    is there any way of rectifying this?

    January 15th, 2008 at 6:04 am
  3. Victor wrote:

    it says, “Expected class name but found identifier”

    January 15th, 2008 at 6:19 am
  4. Damon wrote:

    @Victor What version of Adium and OS X are you on? I currently am on Leopard and Adium 1.2.

    January 16th, 2008 at 10:02 am
  5. Prceasar wrote:

    Great. I have been struggling with the adium applescript documentation to get the old script working with the new adium 1.2.x.. this does the trick. Thanks!

    January 28th, 2008 at 4:12 pm
  6. Prceasar wrote:

    one thing I would add:
    instead of:
    send (first chat whose contacts contains user) message im_message
    I used:
    set im_chat to first chat whose contacts contains user
    tell im_chat to activate
    send im_chat message im_message

    that way if the chat already exists, but a window for it is not open, it will open the window

    January 28th, 2008 at 4:39 pm
  7. Ray wrote:

    Very handy script, thanks. I noticed after using it to send an IM, the focus goes to the chat window.

    But I’d rather have the focus remain on my current active window so I can continue with whatever I was doing. Is that possible?

    Thanks again.

    April 2nd, 2008 at 3:48 am
  8. Tim Rosenblatt wrote:

    Hey, thanks for making this. I was having problems with outdated versions, but with Adium 1.2.5 and Quicksilver B54 (is it B?)

    I think the next level would be to get a list of matching screen names out of Adium, display a drop down, and show which user will actually receive the message. Any thoughts on how this could be done?

    May 16th, 2008 at 7:56 pm
  9. Mr. Rosenblatt: The Blog » Quicksilver + Adium wrote:

    [...] I’ve had a MacBook Pro for about 3 days now, and I’m loving it. One really sweet program is Quicksilver, which is like the Windows Run dialog on steroids. There’s a great script I’ve just started using that lets you send Adium IMs from Quicksilver [...]

    May 16th, 2008 at 8:03 pm
  10. Christian wrote:

    Hhm … doesn’t work for me ;(
    Maybe its because of Adium X 1.3?

    August 26th, 2008 at 11:03 am
  11. Pete wrote:

    It also doesn’t work for me. So close, I can smell it. Quicksilver B54 and Adium 1.3, here’s what’s showing up in the console:

    8/27/08 3:29:45 PM Quicksilver[3728] error {
    NSAppleScriptErrorAppName = Adium;
    NSAppleScriptErrorBriefMessage = “Can\U2019t get title of contact.”;
    NSAppleScriptErrorMessage = “Adium got an error: Can\U2019t get title of contact.”;
    NSAppleScriptErrorNumber = -1728;
    NSAppleScriptErrorRange = NSRange: {0, 0};
    }

    August 27th, 2008 at 2:31 pm
  12. Damon wrote:

    Yea, I think Adium had some pretty significant changes with respect to the contact list in 1.3. I don’t actually use Quicksilver anymore, but I may install it and try to figure it out unless somebody else gets to it before I do.

    Update
    The code seems to work by removing the or title starts with im_contact_name portion. Seems that property disappeared in the most recent version.

    August 27th, 2008 at 3:04 pm
  13. Pete wrote:

    Brilliant. It does work for me now. Thank you very much!

    August 28th, 2008 at 9:33 am
  14. Jon wrote:

    I’m new to QS, I don’t know anything about code (I teach myself web design, so I’ve learned HTML), I don’t quite fully understand what a “plist” is, though I have some idea. However, within three tries, I managed to do this properly and make this work. Absolutely wonderful, thanks a million! this is awesome.

    October 1st, 2008 at 12:04 pm
  15. Cezex wrote:

    Adium developers start to irritate me, they change applescript support every new release. Now the following line stopped working on version 1.3.2:

    set user to first contact whose starts with im_contact_name

    Any ideas how to fix it ?

    October 23rd, 2008 at 1:52 pm
  16. Cezex wrote:

    of course it should be:

    set user to first contact whose display name starts with im_contact_name

    October 23rd, 2008 at 11:36 pm
  17. April wrote:

    Just a note, if you replace “display name” with “name”, the script will work with v.1.3.2.

    December 9th, 2008 at 9:34 pm
  18. Bah wrote:

    This doesnt work for QS B56 and Adium 1.3.2

    January 6th, 2009 at 11:34 am
  19. Benny wrote:

    Doesn’t work with Adium 1.3.3 and quicksilver ß54.

    Dammit.

    February 25th, 2009 at 6:22 pm
  20. Lukasz wrote:

    Doesn’t work for me neither on Adium 1.3.3

    April 3rd, 2009 at 6:02 am
  21. alin wrote:

    work normally in my mac

    qs b54
    adium 1.3.3

    April 4th, 2009 at 1:08 am
  22. Slimmoo wrote:

    Works for me, but it is a bit cumbersome just to send a lol or somthing. and also typing the names sucks as well. It would be better if we could just get a list of your contacts, or have a reply to last message option.

    May 2nd, 2009 at 11:58 am
  23. Damon wrote:

    For anybody just looking to tweet from QS, there’s a good looking script here: http://dyve.net/2009/03/04/improved-twitter-for-Quicksilver-tweetscp/

    May 20th, 2009 at 8:02 am
  24. Casey Becking wrote:

    Doesn’t work for QS-b56a7 + Adium 1.3.6 .. Any ideas?

    September 30th, 2009 at 1:45 pm
  25. Casey Becking wrote:

    My Error is

    9/30/09 2:52:23 PM Quicksilver[3216] error {
    NSAppleScriptErrorAppName = Adium;
    NSAppleScriptErrorBriefMessage = “Can\U2019t get contact 1 whose name starts with \”blah_blah \”. Invalid index.”;
    NSAppleScriptErrorMessage = “Adium got an error: Can\U2019t get contact 1 whose name starts with \”blah_blah \”. Invalid index.”;
    NSAppleScriptErrorNumber = -1719;
    NSAppleScriptErrorRange = NSRange: {0, 0};
    }

    September 30th, 2009 at 1:51 pm

Leave a Reply