I just want to use AppleScript to open an existing group in Mac Address Book (v7.1).
tell application "Contacts"
set selected of group "friend" to true
activate
end tell
above is the sample code for what I want.
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityI just want to use AppleScript to open an existing group in Mac Address Book (v7.1).
tell application "Contacts"
set selected of group "friend" to true
activate
end tell
above is the sample code for what I want.
This probably isn't the best Applescript code ever written but it did work for me to list the people in a specific group (on 10.8 mountain lion).
tell application "Contacts"
activate
set grp to first group where (name = "friend")
tell grp
get people
end tell
end tell
Above script works only if the group with name 'friend' actually exists. Otherwise the statement 'set grp to first...' fails. Thus it is safer to write
tell application "Contacts"
activate
if group "friend" exists then
set grp to first group where (name = "friend")
tell grp
get people
end tell
end if
end tell