Mental Masturbation, Musings, and Methods

The Mind of Alex Beutel

iChat, Adium, and Quicksilver

May 12th, 2008 · No Comments

So recently Adium has been annoying me because it seems to not pay attention to if I am actually connected to the internet.  It says I'm online when I lose my connection and as a result I lose full connections.  As a result I have been switching back and forth and sometimes using both iChat and Adium.  As a result, I had to modify my AppleScript from the previous post.  I also this time used some code from here. Anyway the update checks to see if I am using either Adium or iChat, and does the appropriate action for each. The updated Away file is as follows:

APPLESCRIPT:
  1. using terms from application "Quicksilver"
  2.     on process text ThisClipping
  3.         if appIsRunning("Adium") then
  4.             tell application "Adium"
  5.                 set the status type of the first account to away
  6.                 set the status message of the first account to ThisClipping
  7.             end tell
  8.         end if
  9.         if appIsRunning("iChat") then
  10.             tell application "iChat"
  11.                 set status message to ThisClipping
  12.                 set status to away
  13.             end tell
  14.         end if
  15.  
  16.     end process text
  17. end using terms from
  18.  
  19. on appIsRunning(appName)
  20.     tell application "System Events" to (name of processes) contains appName
  21. end appIsRunning
  22. And the updated Available file is:
  23. <pre lang="AppleScript">
  24. if appIsRunning("iChat") then
  25.     tell application "iChat"
  26.         set status to available
  27.         set status message to ""
  28.     end tell
  29. end if
  30. if appIsRunning("Adium") then
  31.     tell application "Adium" to go available
  32. end if
  33.  
  34. on appIsRunning(appName)
  35.     tell application "System Events" to (name of processes) contains appName
  36. end appIsRunning

Enjoy and please leave comments.

Tags: AppleScript · Programming

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment