Alex Beutel's Blog

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:

?View Code APPLESCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using terms from application "Quicksilver"
	on process text ThisClipping
		if appIsRunning("Adium") then
			tell application "Adium"
				set the status type of the first account to away
				set the status message of the first account to ThisClipping
			end tell
		end if
		if appIsRunning("iChat") then
			tell application "iChat"
				set status message to ThisClipping
				set status to away
			end tell
		end if
 
	end process text
end using terms from
 
on appIsRunning(appName)
	tell application "System Events" to (name of processes) contains appName
end appIsRunning

And the updated Available file is:

?View Code APPLESCRIPT
1
2
3
4
5
6
7
8
9
10
11
12
13
if appIsRunning("iChat") then
	tell application "iChat"
		set status to available
		set status message to ""
	end tell
end if
if appIsRunning("Adium") then
	tell application "Adium" to go available
end if
 
on appIsRunning(appName)
	tell application "System Events" to (name of processes) contains appName
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