Whereas you could modify the script I just posted to select a particular AIM account to sign into, I just discovered that it's also possible to get iChat to log in to an arbitrary screen name specified by the script. My method is to overwrite the screen name of the first account in iChat prefs. This is problematic if you want to actually keep that account the way it was, but iChat otherwise handles the new name without a hitch, and even prompts for a new password to store in the keychain.
Michael Henley
sign on "foo"
to sign on an_account tell application "iChat" to quit tell application "System Events" if "iChatAgent" is in name of every process then do shell script "killall iChatAgent" tell the property list file ((path to preferences as string) & "com.apple.iChat.AIM.plist") tell the first property list item of property list item "Accounts" copy name to account_id copy an_account to the value of property list item "LoginAs" end tell copy account_id to the value of property list item "ActiveAccount" end tell end tell tell application "iChat" to log in service "AIM" end sign |