How To: Make macOS ask for permission again

The problem

macOS asks for permission if an app wants to access e.g. Calendar.app.
Unfortunately it asks only one time, i.e. if one doesn’t click the right button it will never ask again.

Writing a new extension whose AppleScript needs to access Calendar.app I didn’t get a permissions dialog (I guess I denied access to Calendar in the past, but really no idea how that could have happened as I don’t have an extension that needs access to it).

Resetting macOS permissions database

Even after resetting the permissions database with

sudo tccutil reset Calendar

and

tccutil reset All com.pilotmoon.popclip

and restarting I couldn’t make macOS ask again. Checking System Preferences I could tell that the tccutil commands did work, i.e. after using them Calendar was empty and PopClip was removed from Automation. But still no permissions dialog.

The solution

Short before giving up I tried this:

  • Create a shell script (extension .sh) that runs the AppleScript via osascript
osascript -e 'set theDate_AppleScript to current date

tell application "Calendar"
	view calendar at theDate_AppleScript
end tell'
  • In the config.plist

    • change the AppleScript File key to Shell Script File
    • change the key’s value to the shell script’s name
  • Use extension

YES!

This triggered a dialog asking for permission to access Calendar!


YES! YES! YES!

2 Likes

Nice job. Well done delving into the delights of macOS permissions system … I’m sure others will find this handy.

1 Like

Hallo Peter, ich antworte auf Englisch, sei mir nicht böse :wink:
It happens to me so often at any update of my quite many ‘system utilities’ (exempli gratia when I update Default Folder) that the permissions I gave already are not working for the new release and are asked again. It is not the same as not being asked at all, as your case, but this could be related by the OSX version. Anyway try this simple, easy and quick trick (I wonder if you did already not, being you so clever aber du bist ja ein Deutscher und bevorzugst die Eiger Nordwand alleine im Winter aufzuklettern als ‘lustig-lustig trallalalala’ runter 'fröhlich singen und springen’:wink:):
you must go as usual to the ‘Accessibility’… Ok, you know, UNCHECK the permission and recheck it… :blush: