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 theTCC.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.