0
tell application "Contacts"
    set allPeople to every person
end tell

When my program reaches this part of the code, it crashes with the error "Contacts got an error: Application isn't running (-600)." It's definitely running. I have the Contacts box checked in the App Sandbox menu of Xcode, and I granted permission for my app to access Contacts when I was prompted. If I turn off the sandbox, the program works without issue.

I've also tried running tccutil reset AddressBook in Terminal to reset privacy preferences for Contacts, but I still have the same issue.

mdl00
  • 11
  • 3
  • You likely need to set up an entitlement to access Contacts... – l'L'l May 13 '16 at 03:08
  • I do have one set up. That is what I meant by "I have the Contacts box checked in the App Sandbox menu," but sorry if my wording was confusing. In the entitlements file, I see: `com.apple.security.personal-information.addressbook` with a value of YES. It's weird that the error says the application isn't running, instead of something to do with privileges. But I do know that turning the sandbox off allows it to work properly. – mdl00 May 13 '16 at 03:41
  • The entitlements you have is correct. The error message is listed [here](https://developer.apple.com/library/mac/documentation/AppleScript/Conceptual/AppleScriptLangGuide/reference/ASLR_error_codes.html). I would recommend a reboot, and then try your sandboxed app again. Also see this answer... http://stackoverflow.com/a/19974198/499581 – l'L'l May 13 '16 at 03:53
  • I will give that a try, thanks. I will also try it on a different computer. Stay tuned... – mdl00 May 13 '16 at 06:18
  • Just an update, this issue still occurs after a restart, and also occurs when I try to run the app on another Mac. Per your links, it looks like error -600 is an OS X error, so perhaps I just need to report this to Apple... sigh, then it will probably take ages for them to fix it. – mdl00 May 15 '16 at 23:21
  • Yes, I would recommend reporting it to Apple. – l'L'l May 15 '16 at 23:25
  • One more thing I wanted to mention, was that it might be worth trying "Tell application Contacts" and on the next line "activate"... or something along those lines. – l'L'l May 15 '16 at 23:33
  • I was able to get around this by adding a temporary exception for Apple Events and adding the UTI `com.apple.AddressBook`. Now it works OK. I'll use this until Apple can fix the issue. – mdl00 May 15 '16 at 23:44

0 Answers0