Skip to content

Instantly share code, notes, and snippets.

@cilquirm
Created June 1, 2011 14:29
Show Gist options
  • Save cilquirm/1002391 to your computer and use it in GitHub Desktop.
Save cilquirm/1002391 to your computer and use it in GitHub Desktop.
Add Aim Contacts to Google Talk on iChat
tell application "iChat"
activate
repeat until status is available
delay 0.5
end repeat
set gtalk_service to first service whose service type is Jabber and name contains "gmail.com"
set aim_service to first service where service type is AIM
repeat until status of gtalk_service is available
delay 0.5
end repeat
repeat until status of aim_service is available
delay 0.5
end repeat
set aim_buddies to buddies of aim_service
repeat with aim_buddy in aim_buddies
set aim_handle to handle of aim_buddy
set aim_first_name to first name of aim_buddy
set aim_last_name to last name of aim_buddy
set gtalk_aim_handle to aim_handle & "@aol.com"
if not (exists (first buddy in gtalk_service whose handle is gtalk_aim_handle)) then
set gmail_window to (first window whose name is (name of gtalk_service))
tell gmail_window
set index to 1
set visible to false
set visible to true
end tell
tell application "System Events"
tell process "iChat"
click menu item 6 of menu "Buddies" of menu bar 1
tell sheet 1 of window (name of gmail_window)
select combo box 1
keystroke gtalk_aim_handle
keystroke tab
keystroke aim_first_name
keystroke tab
keystroke aim_last_name
click button "Add"
end tell
end tell
end tell
end if
end repeat
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment