Address Book

Is the example: AddressBook suposed to work, or has been deprecated?
On my Mac the Address Book is called Contacts.

On latest MacOS 10.14.6 and latest Xojo 19, 1.1.don’t seem to work.

yes… it does not return any contacts…

it works for me on 10.11.6 and latest Xojo.

just found this

[quote]3

I heard back from a Developer Technical Support Engineer at Apple and he said:

“I’ve asked the engineering team about this and indeed, we have removed support for both compiled and AppleScript-based AddressBook plugins in Mojave 10.14.”[/quote]

You need to use CNContactStoreMBS from the MBS plugin. Even if I’m trying to be nice I can only call this monster insane.

In macOS 10.11, Apple introduced a new mechanism for accessing the “Address Book” / “Contacts”. I am not at my work 'puter, but I suspect that if you look through Feedback you’ll find requests to update to the newer API.

MacOS 10.14.6 and Xojo 2019r1.1

In my apps I succesfully retrieve data with this snippet:

[code]Dim book as AddressBook = System.AddressBook
Dim Contacts() as AddressBookContact = book.Contacts
Dim groups() as AddressBookGroup
dim theData as addressBookData

if UBound(Contacts) >= 0 then
dim a, aa, z, mSplit(), temp as string
For i as integer = 0 to Ubound(Contacts)
a = “”
a = contacts(i).firstname
aa = contacts(i).lastName
if a = “” and aa = “” then//avoid groups
else
if a <> “” then a = a + " "
if aa <> “” then a = a + aa
if a <> “” then a = trim(a) + " <"
z = “>”
end if
thedata = contacts(i).emailaddresses
//etcetera[/code]

I used to use an applescript to let users import only contacts they wished. It was very handy, but a couple of years ago I disposed of it because I foresaw that sooner or later MAS might force me to remove it. Thanks, Apple, for helping us cripple our apps.