Fix Permissions for Executing AppleScript in MIDI Translator Pro

Terminal commands to fix AppleScript permissions for MIDI Translator Pro.

I found them here.

They work by editing directly the TCC database, which is used by macOS to store which application has special permissions.

Disclaimer: use these commands at your own risk. They directly modify internal MacOS settings.
Tested on MacOS 13 Ventura and MacOS 14 Sonoma

Step 1: Before editing the TCC database, back it up. Just in case.

cp ~/Library/Application\ Support/com.apple.TCC/TCC.db ~/TCC-Backup.db

If you get the error Error: unable to open database "/Library/Application Support/com.apple.TCC/TCC.db": authorization denied and any other file operations on the TCC.db file all fail, your terminal app itself is missing the full disk access permission required to read the DB file. i.e. I can’t run the command from vscode but it works from iTerm because that’s how my permissions are set up. That’s addressed in rdamazio’s answer.
From StackExchange.

Step 2: Add System Events Automation permissions for MIDI Translator Pro.

If you’re on macOS 13 Ventura:

sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "insert into access values ('kTCCServiceAppleEvents', 'com.bome.miditranslator.pro', 0, 2, 3, 1, '??', NULL, 0, 'com.apple.systemevents', '??', NULL,1571402310);"

If you’re on macOS 14 Sonoma:

sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "insert into access values ('kTCCServiceAppleEvents', 'com.bome.miditranslator.pro', 0, 2, 4, 1, '??', NULL, 0, 'com.apple.systemevents', '??', 0,1732229701,NULL,NULL,'UNUSED',0);"

If you get Error: stepping, UNIQUE constraint failed, delete the entry first using the delete command below.

Step 3: Restart MIDI Translator Pro. If that does not help, restart the computer.

And voila, now it works! I now have the necessary entries under ‘Security → Automation’ and MIDI Translator Pro executes the scripts perfectly!

You can repeat the command with com.apple.system replaced with com.apple.finder to add permissions to send AppleScript commands to Finder.

Other Commands

Read the current status of the automation permissions:

sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "select * from access where service='kTCCServiceAppleEvents';"

Delete the permissions:

sudo sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "delete from access where client like 'com.bome.miditranslator.pro';"

Thanks for your help! I am so glad that everything is working now.

Hi Helfried,
that’s fantastic! Thanks for sharing. Your sqlite command worked fine for me.

I had lost myself in research, too, but I only got as far as removing the TCC entries using the tccutil tool. But then I could not get the expected behavior that MacOS asks for the permissions when the respective AppleScript is invoked by MT Pro. That seems to be a common problem on MacOS. Once the permission is denied, or removed using tccutil, you are not asked again.

I have cleaned your post a little bit and added a disclaimer and backup. I hope you don’t mind.
Do you have a source where you found the info about the sqlite DB?

thanks for cleaning up, it looks better like this :slight_smile:
This was the link that finally brought the solution after a long search:

It’s about another app, similar problems.
After inserting the corresponding IDs for ‘com.bome.miditranslator.pro’ and ‘com.apple.systemevents’
it worked.
Like you, I had no success with the tccutil commands before.

I have updated the solution above with the correct command for macOS 14 Sonoma.
I haven’t tried on Sequoia yet.

1 Like

It’s not working for me on Sonoma 14.7.1

When I try to do the backup, I get the error ‘cp: /Users/jordi/Library/Application Support/com.apple.TCC/TCC.db: Operation not permitted’:

When I try to write the TCC.db, I get the error ‘unable to open database ‘/Users/jordi/Library/Application Support/com.apple.TCC/TCC.db’: authorization denied’ after entering the password:

I have set write permissions for the TCC.db file and its container folder, but still not working.

From StackExchange:

If you get the error Error: unable to open database "/Library/Application Support/com.apple.TCC/TCC.db": authorization denied and any other file operations on the TCC.db file all fail, your terminal app itself is missing the full disk access permission required to read the DB file. i.e. I can’t run the command from vscode but it works from iTerm because that’s how my permissions are set up. That’s addressed in rdamazio’s answer.

Thanks.

Terminal commands for Sonoma works like a charm. I have added Automation permissions for system events and other applications successfully.

That’s great. Finally!

Now back to your other issue re: virtual desktops…

Yes, I hope you can find a solution for that problem.

Thanks for your help and efforts!!