Send As IM = Adium + Quicksilver
I am now officially in the process of making everything I do Quicksilver-friendly. This round: Adium. The Adium plugin for Quicksilver has been dead since ß36, which means we have to click on things to send IMs. Until now.
The upshot? Cmd+Space, period, “Contact name: Message”, tab, S, enter.
First, 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"
send (first contact whose (online is true and (display name starts with im_contact_name or UID starts with im_contact_name))) message im_message
end tell
return nothing
end process text
end using terms from
Second, Installing It
Paste the script into Script Editor and save it in ~/Library/Application Support/Quicksilver/Actions as Send As IM.scpt.
Restart Quicksilver (Cmd+Ctrl+Q).
Third, Using It
Open up Quicksilver (either Ctrl+Space or Cmd+Space), and hit period. Type your message in the following format: “Contact name: message body.” (e.g., “Bob: Hey man, what’s up?”). Hit tab when you’re done. Type out as much of “Send As IM” as you need to select the Send As IM action. Hit enter. Done!
Send As IM finds the first online contact on your buddy list whose display name or screen name starts with what you entered as the contact name. If you’re not already chatting with them, it’ll open up a new chat window and send your message. If you’re already chatting with them, it’ll use the existing window.
Ok… now what else do I use the mouse for?
January 22nd, 2007 at 3:30pm
Awesome!
January 25th, 2007 at 2:02pm
Bloody brilliant - I’ve been wanting this since I got my laptop and never took the time to figure it out. So nice to see how simple this is, well done
January 25th, 2007 at 2:07pm
[...] Send im’s via quicksilver [...]
February 4th, 2007 at 2:39pm
[...] screenshots to Campfire with only a few keystrokes (riffing of my colleague Coda Hale’s desire to eliminate the need for a mouse). Note that this is for Mac users only, so if you’re one of the poor [...]
February 5th, 2007 at 3:44pm
YOU ROCK!!!! thank you thank you thank you
February 7th, 2007 at 11:18pm
[...] Send As IM = Adium + Quicksilver | Archives | codablog | Coda Hale Handy script that allows you to start IMing through Adium using Quicksilver. (tags: apple mac osx quicksilver scripts adium im) [...]
March 16th, 2007 at 10:00pm
Having a little trouble getting this working…any suggestions on what i might be doing wrong? Do I save the file as “Actions as Send As IM.scpt.” and place that into directory:
/Library/Application Support/Quicksilver/
Or am I supposed to put it into the “action.plist” document? Thanks
March 16th, 2007 at 10:03pm
Elliot: Create a folder named “Actions” in /Users/(your username)/Library/Application Support/Quicksilver. Put the script in there.
March 20th, 2007 at 2:08pm
yeaha… :D that rocks (:
March 27th, 2007 at 9:14am
man! you rock :)
April 5th, 2007 at 4:18am
The site looks great ! Thanks for all your help ( past, present and future !)
April 6th, 2007 at 2:56pm
Pretty cool… But it’d be even cooler if you could send someone an IM by looking up their contact info first, like it’s done with iChat…
April 6th, 2007 at 2:58pm
I agree, Rubin, but that’d require a full-on Quicksilver plugin, which is way more complicated than a simple Applescript.
April 15th, 2007 at 7:25pm
Dude, I can’t tell you how awesome this is.
Thanks for the code. Works like a charm.
April 18th, 2007 at 12:19pm
thank you!
April 29th, 2007 at 1:28pm
quick question.. anyone to have a tabbed window in the background come to the front after this is performed? It works great, but say for example you had an open im to someone else. Doing this opens a new tab, but in the background. Any additions the script we can do?
May 2nd, 2007 at 1:00am
Firstly - Script is great so a big thankyou!
Rainman’s got a really good point there - I’d Love to bring the window/tab to the front as well.. but I’d like to have it as a duplicate script with the setfocus bit on the end - so I’d have a separate script “Send and setFocus” as well as the original becuase I think sending it in the background is actually really useful!
Thanks again
May 11th, 2007 at 12:36am
[...] Send as IM = Adium + Quicksilver (tutorial) [...]
May 12th, 2007 at 9:07am
You might be interested in contributing to the Quicksilver plugin, as it’s perpetually under development, under supported and, well, breaking.
May 12th, 2007 at 3:44pm
This doesn’t work at all for me, I have no idea why. When I hit “execute” the window just goes away, there’s no IM that’s sent. I made an actions folder, put the script in it, and I can select the script after I type my message, but it doesn’t work. Maybe I’m doing something wrong when identifying contacts? I’ve tried both the contact list name and the account name, nothing. Any suggestions?
May 14th, 2007 at 4:43pm
Did not work for me either. I get the same thing described above by K.
May 21st, 2007 at 5:14am
Great initiative Coda!
Looks like this does not work with more recent versions of Adium. Just lik K and J I am unable to get this to work at all.
May 31st, 2007 at 8:48pm
Doesn’t work for me either :(
Adium 1.0.4 connected to 2 jabber accounts.
August 16th, 2007 at 4:40pm
AWESOME!
You rock!
August 18th, 2007 at 12:13pm
I have Adium 1.1.1 and quicksilver ß51 and this doesn’t appear to work, did Adium change and break the script?
September 6th, 2007 at 8:05pm
@hackerjoe: script works fine wiht 1.1.2
-stef
September 24th, 2007 at 1:49am
Thanks, works well.
I removed
online is true andsince I mainly want this to message offline users.September 26th, 2007 at 12:49pm
I can’t get this to work with Adium 1.1.2 / QS β51 (3800)
Send As IM.scpt shows up in my action list but nothing happens upon execution. I even tried chmod 777 in case it was a permissions issue, but no go. Any suggestions?
September 26th, 2007 at 2:58pm
Okay, problem solved and BOY is it embarassing:
I put the code into a text editor and saved it as Send As IM.scpt, not realizing that script files are actually binary objects and have to be edited in the Apple Script Editor–not in a regular text editor.
Once I did that and then restarted Quicksilver (another important step, I found) it worked like a charm.
Thanks for the code and for forcing me to learn something about Applescript today.
September 26th, 2007 at 3:14pm
For those who want the window to be brought into focus, just add “activate” before the send command, like this:
tell application “Adium”
activate
send (first contact whose (online is true and (display name starts with im_contact_name or UID starts with im_contact_name))) message im_message
end tell
October 31st, 2007 at 9:58am
This doesn’t seem to work using Quicksilver B52 (3813) and adium 1.1.3 .. any suggestions?
October 31st, 2007 at 9:29pm
Cheers, thanks. =)
January 12th, 2008 at 8:05pm
Coda, many thanks. My fingers are almost as wired to QuickSilver as they are to vi, and this just helps to feed my growing addiction.
January 16th, 2008 at 3:56pm
Hmmm. I am using quicksilver B54 and Adium 1.2 and this isn’t working :(
I followed the direction and am able to see the script in quicksilver, but when I press enter (after I put in the message), it just won’t send any IMs. :(
January 16th, 2008 at 4:59pm
Awww lame. Looked more into it and found this bug:
http://trac.adiumx.com/ticket/8864
Even if someone changed Coda’s code for 1.2 (which has a totally rewritten applescript support), it won’t work until that bug is fixed.
January 28th, 2008 at 6:29am
Hi,
I’m using QS Beta54
Adium 1.2.1
This site has a working plugin:
http://adiumx.com/pipermail/adium-devl_adiumx.com/2007-April/002591.html
January 28th, 2008 at 6:45am
oops forgot to mention. If the installation was successful, it will tell you to restart Adium. Adium will ask about disabling an external plugin -Don’t disable otherwise the purpose of using QS-Adium chat is defeated.
When you install this plugin, you have to >> QS Preferences >>Handlers
and change from ichat to adium.
When that’s done:
1) invoke QS
2) press period and type the text you want to IM
3) press Tab and type as much as you need to get “IM to account”
4) search the contact and press enter
Adium must be on before you can use this chat option.
February 6th, 2008 at 10:48pm
wooo hoooooo! i just started using quicksilver yesterday, and looks like I joined the band wagon at the right time!!!
This is awesome. Thanks RomDeathknight!
February 14th, 2008 at 1:47pm
RomDeathknight, for some reason when i tab to the third column, it doesn’t register any search attempts. It doesn’t even show the letters being typed to be searched. Any idea why this could be?
February 27th, 2008 at 10:24am
I’m running B53 Quicksilver with Adium 1.2.3 and got the plugin posted by RomDeathknight working.
My first attempt yesterday was the same result as Jack’s. This morning Adium prompted to load an external plugin, which I didn’t get before. I was pretty sure I restarted Adium as well as Quicksilver, but perhaps not. After a full restart I can now use QS to send IM’s :-)
April 10th, 2008 at 9:15pm
Hi.
I’ve owned a Mac for a week, Quicksilver for 2 days and an hour ago was my first foray into Applescript. I am, however, extremely obsessive, so I refused to go to sleep until I got your script working in Adium 1.2. They definitely changed the object model considerably, but I managed to hack together something that works for me (at least in the most basic of cases; I don’t know how to handle errors yet :) ).
Hope it helps someone out there…
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"
activate
set destContact to (first contact whose (status type is not offline and (display name starts with im_contact_name)))
set destAccount to (account of destContact)
tell destAccount to set destChat to make new chat with contacts {destContact} with new chat window
tell destChat to send message im_message
end tell
return
end process text
end using terms from
April 10th, 2008 at 9:20pm
Err, OK, so that obviously didn’t work (you could really use a preview feature here!). So, just in case, I pasted it here:
http://moestaverne.com/nopaste/?691
April 10th, 2008 at 9:23pm
I just realized, the next hit in Google was someone who fixed it several months ago (and, unlike me, obviously knows what he’s doing). Figures. Anyway, it was a fun waste of time!