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


Click here to return to the '10.3: A script to copy iChat buddy icons to Address Book' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.3: A script to copy iChat buddy icons to Address Book
Authored by: argh128 on Dec 14, '03 07:46:04PM
-- Source macosxhints
-- modified by Nicholas Shanks
-- posted by Alex Eiser
-- Asks you if you want to skip a user
tell application "iChat"
	repeat with curAccount from 1 to number of items in accounts
		if exists image of account curAccount then
			set theName to the name of account curAccount
			set theImage to the image of account curAccount
			tell application "Address Book"
				if person theName exists then
					if exists image of person theName then
						set theReply to display dialog "Replace image of " & theName & " with their iChat buddy icon?" buttons {"Abort", "Skip", "Replace"} default button "Skip" with icon caution
					else
						set theReply to display dialog "Add image for " & theName & " to your address book?" buttons {"Abort", "Skip", "Add"} default button "Add" with icon 1
					end if
					if (button returned of theReply is "Replace") or (button returned of theReply is "Add") then
						set image of person theName to theImage
					else if button returned of theReply is "Abort" then
						exit repeat
					end if
				end if
			end tell
		end if
	end repeat
end tell
This amendment asks if you want to replace the photo in your address book.
It also intelligently sets the default button if the address book record already has an image.

---
--

A completely SANE Canadian.

[ Reply to This | # ]