Damon Cortesi's blog

Musings of an entrepreneur.

Adium + Quicksilver Script

| Comments

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<div class='bogus-wrapper'><notextile><figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>using terms from application "Quicksilver"
</span><span class='line'>  on process text im_text
</span><span class='line'>      repeat with im_delimiter_position from 1 to (length of im_text)
</span><span class='line'>          if character im_delimiter_position of im_text = ":" then exit repeat
</span><span class='line'>      end repeat
</span><span class='line'>      set im_contact_name to characters 1 thru (im_delimiter_position - 1) of im_text as string
</span><span class='line'>      set im_message to characters (im_delimiter_position + 2) thru (length of im_text) of im_text as string
</span><span class='line'>      tell application "Adium"
</span><span class='line'>          
</span><span class='line'>          set user to first contact whose (status type is available and display name starts with im_contact_name)
</span><span class='line'>          
</span><span class='line'>          if not (exists (chats whose contacts contains user)) then
</span><span class='line'>              tell account of user to (make new chat with contacts {user} with new chat window)
</span><span class='line'>          end if
</span><span class='line'>          
</span><span class='line'>          send (first chat whose contacts contains user) message im_message
</span><span class='line'>      end tell
</span><span class='line'>      return nothing
</span><span class='line'>  end process text
</span><span class='line'>end using terms from</span></code></pre></td></tr></table></div></figure></notextile></div>

The procedures for installation and usage are the same.

  • Paste the script into Script Editor and save it in
    1
    
    ~/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.

Comments