MIDI Translator Pro not executing AppleScript on OSX 14.7

Greetings.
Attempting to port some AppleScripts from OSCulator over to MIDI Translator Pro. The scripts execute in OSCulator and Script Editor, but not when using the test button within Bome MTP. I have Full Disk Access and Developer Tools turned on form MTP in Privacy&Security. What am I missing to get this fine product to talk to the rest of the system?

The problem seems independent of the code content, but for reference, the script text is:

set apiURL to "http://192.168.104.10/config?action=set&paramid=eParamID_ReplicatorCommand&value=3"
do shell script "curl " & quoted form of apiURL

Thank you.
Yours,
C.Perkins

Hi and welcome to the Bome community!

I’m pretty sure this is an Apple permissions think. I suggest you review this thread.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Steve,
Thank you - I tried the steps in that thread and received the following error in Terminal after asserting the sudo sqlite3 command sequence:

Error: in prepare, table access has 17 columns but 13 values were supplied

l know that’s more of an Apple support issue than Bome, but I welcome any insight you can provide. Is this perhaps an OS version issue?

Thank you.

Yours,

C.Perkins

It is probably a misplaced comma, double quote or single quote in your command line.

Apple Support has sent me back to you, ‘We don’t have control over how the application calls the OS.’
-CP

Could you send show me the sudo commands that you sent? (maybe copy and paste them into the posting).

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

That is quite a statement from Apple! Anyway, it could be a permissions issue, or other hurdles that macOS is putting on executing AppleScript code from applications.

We will follow up with the general problem. But for your particular script, I think that you should be able to use the ‘Execute File’ outgoing action.

Thank you - the scripts with the curl commands to send out REST API data seem to work fine. I tried to use the Execute File option to run a compiled AppleScript application. I can run the applet from Finder, which prompted the OS permit dialog (which I authorized). That runs the desired action within Safari, which tells me the script / applet itself is OK.

Calling the applet executable from Execute File returns the error / dialog box:
Not authorized to send Apple events to Safari. (-1743)
which is what was MIDI translator was logging before, just not generating a dialog.

For good measure, I opened the package contents of the app and ran the applet the same way MIDI translator allows within Execute File, which prompted for authorization. After allowing, I tested in MT again - no change.

Just for reference (and since you asked), the script I’m trying to run is:
tell application ‘Safari’

do JavaScript ‘document.getElementsByClassName(“LiveController-action LiveController-action–next”, 0)[0].click();’ in document 1

end tell

I may be able to work around by calling System Events to execute a mouse click where I know the browser-based button will be on the screen.

I welcome any insight you can offer.
Thank you.
-CP

Hi Chris,

It appears that we are trying to work around an Apple issue. I still would like to see the command that you typed that returned this error message.

Error: in prepare, table access has 17 columns but 13 values were supplied

From the errror message, it appears the command you typed was not correct.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Just to make sure we understand what the issue is: once a process (like MIDI Translator Pro) tries to execute AppleScript, MacOS asks the user if that’s allowed. If the user denies that request, there is no way in MacOS to revert that decision. Consequently, that process is blocked from executing AppleScript forever.

Now here, it seems that MacOS has blocked AppleScript for MIDI Translator Pro on Chris’ computer. The only way we know for persuading MacOS to allow MT Pro to execute AppleScript is to directly edit the internal MacOS database containing these permissions, as outlined in this thread:
https://forum.bome.com/t/mt-pro-problem-executing-apple-script/5737/12

On our computers, we have been able to confirm that the described approach works.

I am on Sonoma 14.7.1 and I am experiencing also some problems with not executed AppleScripts from BMTP 1.9.1 build 1064.

System Settings > Automations is not showing any permissions fro BMTP, so I suppose I should try the solution of modifying the TCC.db file with Terminal.

But I have a problem for doing the backup. Terminal says ‘Operation not permitted’, even if I use sudo at the beginning:

jordi@MacBook-MacBook-Pro-de-Jordi ~ % cp ~/Library/Application\ Support/com.apple.TCC/TCC.db ~/TCC-Backup.db
cp: /Users/jordi/Library/Application Support/com.apple.TCC/TCC.db: Operation not permitted
jordi@MacBook-MacBook-Pro-de-Jordi ~ % sudo cp ~/Library/Application\ Support/com.apple.TCC/TCC.db ~/TCC-Backup.db
Password:
cp: /Users/jordi/Library/Application Support/com.apple.TCC/TCC.db: Operation not permitted

I have tried to change the permissions of the folder and the file directly in Finder, but I can’t add administrators privileges to the file or to the containing folder. They are only allowed (read and write) to ‘System’.

How could I solve this?

now that we have two reports that the TCC approach is not working (anymore?), I’ll look into it again… I’ll report back here.

1 Like

Let me add some information that maybe is useful to you.

I have installed recently macOS Sonoma (a clean installation).

The first app I installed on Sonoma was BMTP, for checking the issue of switching apps after pressing the cmd+tab shortcut (see this post). I was experiencing this issue on Ventura and I was not sure if it was an issue of BMTP or something in my setup/configuration. So I installed it first.

As I said, BMTP is the first application I’ve installed on Sonoma. And I’m sure that macOS has never asked me to allow Automation permissions for BMTP (I have been asked for Access to disk folders, Accessibility, and Keyboard monitoring).

Another weird thing is that sometimes BMTP can execute a simple AppleScript like this, but sometimes not:

display notification ‘text’ with title ‘title’

But an AppleScript that calls another AppleScript like the following one is never executed. I use several scripts like this along BMTP. This kind of actions were working fine in BMTP when I was running them on Ventura:

set scriptAlias to (system attribute "HOME") & "/Maquinari/Scripts Library/RME/Totalmix/Varis/Check Totalmix status for BMTP.scpt"
	run script scriptAlias
	set rR to result
	return rR

Hi Chris, I’ve found the issue and updated the post for macOS 14 Sonoma:
https://forum.bome.com/t/mt-pro-problem-executing-apple-script/5737/12

You may need to restart macOS after modifying the TCC database.

@jordikt, I’m still trying to find what’s happening on your system.

1 Like