Entourage Address Book. Update company domain name change.

Our company is changing domain names. People who have people already in their address book with the old domain, i would like to have it changed to the new. I have searched for something but haven’t found anything to help automate it.

so here is what is happing.

changing form first_last@nyc.company.com

to first.last@company.com

i was able to change the users entourage settings by writing this script.

I am wondering if it can be used to hook into the address book and update contacts.

tell application "Microsoft Entourage"
	email address of default mail account
	set ourText to result
end tell
set findThis to "_"
set replaceItWith to "."
set newText to switchText of ourText from findThis to replaceItWith
to switchText of theText from SearchString to ReplaceString
	set OldDelims to AppleScript's AppleScript's text item delimiters
	set AppleScript's AppleScript's text item delimiters to SearchString
	set newText to text items of theText
	set AppleScript's AppleScript's text item delimiters to ReplaceString
	set newText to newText as text
	set AppleScript's AppleScript's text item delimiters to OldDelims
	return newText
	set newText to ourText2
	return ourText2
	
end switchText


set ourText2 to newText
set findThis2 to "@nyc.company.com"
set replaceItWith2 to "@company.com"

set newText2 to switchText2 of ourText2 from findThis2 to replaceItWith2
to switchText2 of theText2 from SearchString2 to ReplaceString2
	set OldDelims to AppleScript's AppleScript's text item delimiters
	set AppleScript's AppleScript's text item delimiters to SearchString2
	set newText2 to text items of theText2
	set AppleScript's AppleScript's text item delimiters to ReplaceString2
	set newText2 to newText2 as text
	return newText2
	
end switchText2
tell application "Microsoft Entourage"
	set email address of default mail account to newText2
end tell