I tried a few variations on tccutil reset…
First, I tried it with sudo
:
Argus-2:~ nello$ sudo tccutil reset AddressBook com.mycompany.Birthday-Message-ver-5
Password:
Successfully reset AddressBook approval status for com.mycompany.Birthday-Message-ver-5
Argus-2:~ nello$
Still got the same error.
Then I tried resetting privacy for all applications requesting access to Contacts:
Argus-2:~ nello$ tccutil reset AddressBook
Successfully reset AddressBook
Argus-2:~ nello$
As expected, this access to Contacts for all applications:
I ran my script within Script Debugger, was prompted for permission to access Contacts, authorized access, and the authorization appears in the Privacy tab:
Then I tried double clicking on my applet; I was NOT prompted for permission and access was denied:
Then I noticed that (Script Debugger?) had auto-saved my script:
So, I double clicked on the Autosaved
file, and I got these TWO dialogs to allow permission, which I did:
And lo and behold, the auto-saved applet appears in the Privacy tab now:
When I double click on the original applet and I still get the error.
When I double click on the Autosaved
applet, it runs.
Then saved the the script using Save As…
using the format Application (Apple)
and it replaced the Autosaved applet file.
When I double click on the Save As…
applet, it the same two dialogs appear asking for permission to access Contacts and when I approve both, the applet runs perfectly.
So, I don’t know what it was, but apparently there was something wrong with the first applet that I saved.
The only thing difference that I can think of is that I renamed the original applet (in the Finder) after saving it. Is the applet’s file name somehow tied to permissions? I had assumed that the permissions are tied to the value of CFBundleIdentifier
in the applet’s Info.plist
.
So, I renamed the Save As…
applet’s file name and it still runs perfectly without asking for permission. But interestingly, the new file name has been added to the Privacy tab withOUT asking permission first:
But look closer. I put the Save As…
applet in the trash and notice that it’s been removed from the tab (without emptying the trash). And also, see that the original applet now appears in the tab! But, when I double click on it I still get the same error.
Finally, I’m surprised to see that renaming the applet in the Finder causes the name of the script in Script Debugger to change too:
Anyway, for some reason that first applet wouldn’t trigger a request for permission to access Contacts and so it couldn’t run.
But all the subsequent applets are requesting permission as expected and running perfectly.
All’s well that ends well?