At work, we have a Jabber server that employees use to IM each other, but unfortunately there's no IM access to the outside world. At home, I use a public Jabber server with transports for MSN and ICQ to IM with my friends & family. Unfortunately, iChat only supports one active Jabber account at a time. So I wrote this little AppleScript to swap between the two with little fuss:
property iChatJabberProperties : ¬
"~/Library/Preferences/com.apple.iChat.Jabber.plist"
tell application "iChat"
log out of service "Jabber"
end tell
tell application "System Events"
set the_file to property list file iChatJabberProperties
set active_account to value of property list item ¬
"ActiveAccount" of the_file
set all_accounts to property list items of property list item ¬
"Accounts" of the_file
repeat with this_account in all_accounts
set this_name to name of this_account
if not active_account = this_name then
-- display dialog "Found new account " & this_name
set value of property list item ¬
"ActiveAccount" of the_file to this_name
end if
end repeat
end tell
tell application "iChat"
log in of service "Jabber"
end tell
Note that this script assumes you only have two defined jabber accounts, and swaps from one to the other. If there are more, it will swap to the last one that is not currently active. It could be modified to let the user pick an account, or to work with AIM or .Mac accounts as well, but that is left as an exercise for the reader. Enjoy!