Skip to content

Instantly share code, notes, and snippets.

@ashkrosh
Created April 20, 2017 14:56
Show Gist options
  • Save ashkrosh/ef0970e04642067557918f3a88d3fe8e to your computer and use it in GitHub Desktop.
Save ashkrosh/ef0970e04642067557918f3a88d3fe8e to your computer and use it in GitHub Desktop.
delete all Contacts groups
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