0

I've created a script which uninstalls an application I've created. However, as you may know, in macOS Mojave the system requests the user's permission to allow said script to control System Events. If the user click "Don't allow", the script can't be run and the system won't request the user's permission for that app ever again.

Is there a way to detect if the user has clicked Don't Allow so that, next time the script/app is opened, the user is given instructions on how to allow it to control System Events? (Or even better, request his permission again).

1

Not really.

The permission dialog will only be shown once - after that the only options are to change the System Preferences > Security & Privacy > Privacy > Automation setting (which doesn’t reset the dialog) or reset the privacy database via the tccutil utility (see Apple’s tech note).

There is an AEDeterminePermissionToAutomateTarget function to determine if it is authorized to send an Apple Event to an application, but AppleScript can’t use it because it uses a pointer for the target application reference.

Also see this blog for a decent writeup about this mess.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .