MT Pro: problem executing Apple Script

Wow, that was a long research trip :slight_smile:
After everything failed (complete uninstall and reinstall of MT, reset of TCC database entries… and more experiments) I came across these sqlite commands and customized them.

Disclaimer: use these commands at your own risk. They directly modify internal MacOS settings.

Tested on MacOS 13 Ventura and MacOS 14 Sonoma

Before editing the TCC database, it might be a good idea to back it up. Just in case:

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

Then, add System Events Automation permissions for MIDI Translator Pro:
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);"

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);"

You may need to restart MIDI Translator Pro.

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

And voila, now it works! I now have the necessary entries under ‘Security → Automation’ and Midi Translator executes the scripts perfectly!
Finally a success, I had almost given up.

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

On Sonoma, you may need to restart to make those permissions work.

Here is another command to read the status of the automation permissions:

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

and to delete the generated entries:

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.