Showing Records in the Contacts App

Your app can use the addressbook URL scheme to launch the Contacts app, displaying a particular person record. This URL scheme takes the unique identifier of the person and an optional “edit” parameter, as shown in the following code listing:

ABPerson * aPerson = <#assume this exists#>;
 
// Open the Contacts app, showing the person record.
NSString * urlString = [NSString stringWithFormat:@"addressbook://%@", [aPerson uniqueId]];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:urlString]];
 
// Open the Contacts app, editing the person record.
NSString *urlString = [NSString stringWithFormat:@"addressbook://%@?edit", [aPerson uniqueId]];
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:urlString]];