I have no errors coming out of it, so I am not sure the next troubleshooting step. Can anyone help me out, this is super simple, and I am apparently just not getting it.
So basically, I need to the script to cycle through group "Contacts" and see if the contact has an @domain email address, and if it doesn't then take the first name and last name of the contact and make an email address that is email@hidden.
tell application "Address Book"
set contacts to (every person in group "Contacts")
repeat with thisContact in contacts
repeat with thisEmail in email of thisContact
if value of thisEmail contains "@domain" then
set found to true
exit repeat
if not found then
try
set first_name to first name of thisContact as Unicode text
set last_name to last name of thisContact as Unicode text
set emailentry to first_name & "." & last_name & "@domain.com" as Unicode text
tell thisContact
make new email with properties {label:"Work", value:emailentry}
end tell
on error errmsg number errnum
tell me
activate
display dialog errmsg
end tell
end try
else if value of thisEmail contains "@domain" then
-- beep
end if
end if
end repeat
end repeat
end tell