I have been using Gitk provided by Git provided by Homebrew with success, for several years.

A couple of days ago, it suddenly prompted a security window when called.

I did not allow access, hoping I would be able to change my mind.

Now trying to start Gitk will always cause:

$ gitk --all
Error in startup script: 58:103: execution error: Not authorised to send Apple events to System Events. (-1743)
    while executing
"exec osascript -e [format {
        tell application "System Events"
            set frontmost of processes whose unix id is %d to true
        end te..."
    invoked from within
"if {[tk windowingsystem] eq "aqua"} {
    exec osascript -e [format {
        tell application "System Events"
            set frontmost of processes ..."
    (file "/usr/local/bin/gitk" line 12237)
$ _

I would need to revoke that forbiddance.

I have removed Git and reinstalled:

$ brew remove --force git && brew install git

That didn't solve the case1. Force was used in order to remove all versions.

If I don't fix this, I'd need to get used to either Tig or Sourcetree or some other alternative, with an impact in immediate productivity.

1: After reinstalling, error is the same, just moved to line 12212. That's because I use taint patches on top of official Gitk. As you can see, those patches are unrelated to the cause, so please don't let it make you focus away from the actual issue, which is 100% macOS materials.

  • Thank you very much in advance. - I would thank keeping from not needed comment flags until question is answered. :( – 146438 Oct 10 '19 at 7:26
  • I had looked, couldn't find anything related; looked again, still can't find a good lead to a fix. – 146438 Oct 10 '19 at 7:45
  • That worked and relieves a large pain! – 146438 Oct 10 '19 at 8:02
  • @user3439894 please promote your comment to answer..? – 146438 Oct 10 '19 at 16:38

Check setting under: System Preferences > Security & Privacy > Privacy

If you find nothing there, then in Terminal, read the man page for: tccutil

man tccutil

You can use the following command to reset all permissions you've set on AppleEvents:

tccutil reset AppleEvents

Note that after doing so, you'll have to respond to all previous queries that may come forward again.

Note: A few years back there was a project IIRC on GitHub that allowed reading the privacy database and targeting specific occurrences of a set permission, but I think changes in macOS Mojave crippled it. It might be worth doing a bit of googling if you'er looking to target just a specific occurrence of an app permission that is not available in the GUI.

| improve this answer | |

You must log in to answer this question.

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