Address Book - extracting group names then deleting certain ones

What is the syntax for obtaining a list of the group names in the address book? Also, after determining which ones I want to delete, what is the syntax for doing that? TIA.


try this

tell application "Address Book"
	set groupToDelete to choose from list (get name of groups) with prompt "Choose a group to delete:"
	if groupToDelete is false then return
	display dialog "Are you sure to delete group \"" & item 1 of groupToDelete & quote buttons {"Cancel", "Delete"}
	delete group (item 1 of groupToDelete)
end tell

Perfect. Thanks.