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:
-
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:
-
<pre lang="AppleScript">
-
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.
