Hey all, I am almost completely new to scripting, with only nominal experience and success.
I am trying to take all the contacts from a smart group and look at every email address for those contacts, and if that email address ends with “edu” I want to change the label for that email address to “school”. I thought this would be pretty simple.
Here’s what I have:
tell application "Address Book"
set emailValue to value of email of (every person in group "Email")
set emailLabel to label of email of (every person in group "Email")
set allPeople to id of (every person in group "Email")
repeat with i from 1 to count of allPeople
if emailValue ends with "edu" then
set label to "school"
save
end if
end repeat
end tell
Something must be amiss, but I don’t know what. Can anyone help me out?
Thanks,
Ethfun