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


Click here to return to the 'Switch .Mac/AIM account between Adium and iChat' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Switch .Mac/AIM account between Adium and iChat
Authored by: rossr on Jan 21, '08 04:27:23AM
Applescript support for Adium 1.2 has been completely re-written, so the code above will not work anymore. After digging around, I have re-written the Applescript to work with Adium 1.2x. This script should probably be optimized a bit more (if you have multiple AIM accounts registered in Adium, for example), but it should be a good starting point! :)
(*
	Toggle between Adium and iChat
	(for Adium 1.2)

*)

-- what apps are currently running?
tell application "System Events"
	set aApps to name of every application process
end tell

tell application "Adium"
	try
		-- what's adium's AIM status?
		set adiumAIMStatus to the status type of account of service "AIM" as string		
		if adiumAIMStatus is not "offline" then
			-- if the status is not "offline" set adiumAIMOnline to "yes"
			set adiumAIMOnline to true
		else
			-- if the status is "offline" set adiumAIMOnline to "no"
			set adiumAIMOnline to false
		end if
	end try
end tell

if adiumAIMOnline then
	-- if adiumAIMOnline is "yes" then:
	-- adium: logout of AIM
	tell application "Adium" to go offline of every account of service "AIM"
	delay 5
	-- ichat: login to AIM
	tell application "iChat" to activate
else

	-- if adiumAIMOnline is "no" then:
	-- ichat: if you're running, quit

	if "iChat" is in aApps then
		tell application "iChat" to quit
	end if
	delay 5

	-- adium: login to AIM

	tell application "Adium" to go online of every account of service "AIM"
end if




[ Reply to This | # ]