Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

An AppleScript to swap the active iChat account Apps
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!
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[5,976 views]  

An AppleScript to swap the active iChat account | 3 comments | Create New Account
Click here to return to the 'An AppleScript to swap the active iChat account' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
An AppleScript to change security settings?
Authored by: jump420 on Jul 19, '05 10:57:01AM

Is there any way possible someone can help me by creating an Apple Script that will change the Security Settings. For example at times I want to set my security to Block Specified Users without having to go into the iCHat preferences each time.

Your guidance is much appreciated.



[ Reply to This | # ]
An AppleScript to change security settings?
Authored by: ChrisRyland on Jul 19, '05 11:14:58AM
To the original hinter, have you seen this weblog entry from James Davidson about making your work's Jabber server connectable to the outside world?

---

Cheers!
--Chris Ryland, Em Software


[ Reply to This | # ]

An AppleScript to change security settings?
Authored by: stephanos on Jul 20, '05 04:26:49AM

Thanks for the heads-up Chris, but unfortunately all non-HTTP traffic is blocked at the network layer so none of this stuff helps. We only get HTTP(S) to the outside world and that goes through a proxy (so no setting up a Jabber server on port 80 as the proxy will choke on the XMLPP). As a matter of fact this is a new policy and I'm quite peeved about it - I can't even get my Gmail through POP3 - but they claim it's for security and with most people running relatively unpatched Windows boxen I have to accede. Our jabber server is blocked from accessing or being accessed by the wider world as well, so we can only IM each other.

Bummer.



[ Reply to This | # ]