Created
April 20, 2017 14:56
-
-
Save ashkrosh/ef0970e04642067557918f3a88d3fe8e to your computer and use it in GitHub Desktop.
delete all Contacts groups
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 "Contacts" | |
set theGroupNames to name of groups | |
repeat with i from 1 to number of items in theGroupNames | |
try | |
set groupName to item i of theGroupNames | |
set theGroup to group groupName | |
delete theGroup | |
on error | |
exit repeat | |
end try | |
end repeat | |
save | |
display dialog "Removed all groups" | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment