AddressBook and Sonoma 14.5

I just changed my old Mac Intel under Big Sur to an ARM under Sonoma and it seems my application which read AddressBook contacts doesn’t read anything. When I do:

CesContacts = CeBook.Contacts
NbContacts = CesContacts.LastIndex

I obtain NbContacts = -1. I know it was deprecated years ago because Xojo used an old Apple API. Does Apple removed this API?

1 Like

Ohhhhhhh, I spent many hours writing an AppleScript and modifying my Xojo source to realise the problem was
If (CurrentBuildTarget = 7) or (CurrentBuildTarget = 16) Then
doesn’t work anymore but we have to use
If CurrentBuildTargetIsMacOS Then

How was I suppose to know that? No alert in Xojo, and I read each time the Realise Notes and I don’t remember to read that (I will read it again).

Edit: Sorry, maybe I was angry but my fault. I just bought an ARM Mac and was previously on MacIntel. Maybe CurrentBuildTarget = 7 mean Mac32bitsINTEL and CurrentBuildTarget = 16 mean Mac64bitsINTEL ? Then my ARM builds when I was under MacINTEL never had my scripts applied?

I forgot an explanation in my last post I clarify in case of persons find this post.
I modified my Info.Plist to add:

<key>NSContactsUsageDescription</key>
<string>Read Contacts in your AddressBook.</string>

and it wasn’t add for my ARM build because of my test (which was useless):
If (CurrentBuildTarget = 7) or (CurrentBuildTarget = 16) Then

That’s why I thought AddressBook’s Xojo instructions didn’t work anymore. But they still work under Sonoma.