I’m Exporting from Filemaker to vCard then importing into Address Book. (fully automated)
Since I can’t ‘embed’ the group info in the vCard I have to assign the contacts to their correct group after importing.
To cut to the chase -
After importing I am removing all contacts with nickname ‘xxx’ from 4 groups, one group at a time.
Then add them to the correct group.
I have to do this 4 times for 4 different groups.
Is there a way to remove all contacts with nickname ‘xxx’ from 4 groups in one step and possibly quicker?
My current solution takes a couple of minutes to complete.
tell application “Address Book”
try
set thePeople to every person whose nickname = “Emp Active”
repeat with aThing in thePeople
set Entry_Name to name of aThing
set theid to id of person Entry_Name
remove person id theid from group “Emp Active”
end repeat
save
repeat with aThing in thePeople
set Entry_Name to name of aThing
set theid to id of person Entry_Name
remove person id theid from group “Emp Inactive”
end repeat
save
repeat with aThing in thePeople
set Entry_Name to name of aThing
set theid to id of person Entry_Name
remove person id theid from group “Client Active”
end repeat
save
repeat with aThing in thePeople
set Entry_Name to name of aThing
set theid to id of person Entry_Name
remove person id theid from group “Client Inactive”
end repeat
save
end try
end tell
delay 1
tell application “Address Book”
if group “Emp Active” exists then
else
make new group with properties {name:“Emp Active”}
save
delay 1
end if
set thePeople to every person whose nickname = “Emp Active”
repeat with aThing in thePeople
set Entry_Name to name of aThing
set theid to id of person Entry_Name
add person id theid to group “Emp Active”
end repeat
save
end tell
Browser: Safari 534.57.2
Operating System: Mac OS X (10.6)