UserGuide

AddressBook

From Xojo Documentation

The AddressBook classes are used to access Address Book data on Mac. The available classes are: AddressBook, AddressBookAddress, AddressBookContact, AddressBookData, AddressBookGroup.

The AddressBook class gives you access to the AddressBook. You can also access the AddressBook using System.AddressBook:

Dim book As New AddressBook
// or
Dim book As AddressBook
book = System.AddressBook

To get the contacts in the Address Book, use the Contacts property:

Dim contacts() As AddressBookContact
contacts = book.Contacts

Each contact has properties for the various fields, such as FirstName, LastName, etc. To add a contact, create it and then add it using the Add method:

Dim contact As New AddressBookContact
contact.FirstName = "Bob"
contact.LastName = "Roberts"
book.Add(contact)

AddressBookAddress is used to get address information for a contact. AddressBookData is used to get information such as email addresses, phone or fax numbers. AddressBookGroup gives you information about all the groups in the address book. Use the AddressBook.Groups property to get an array of groups.