Created
December 3, 2011 11:08
-
-
Save echoz/1426879 to your computer and use it in GitHub Desktop.
Add groups that a contact belongs to the company field as CSVs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Address Book" | |
set prefix to ", " | |
repeat with p in (get people) | |
set gs to "" | |
repeat with g in (get p's groups) | |
if (gs = "") then | |
set gs to g's name | |
else | |
set gs to gs & prefix & g's name | |
end if | |
end repeat | |
if (p's organization = missing value) then | |
set p's organization to gs | |
end if | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment