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¶mid=eParamID_ReplicatorCommand&value=3"
do shell script "curl " & quoted form of apiURL
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: tellapplication âSafariâ
do JavaScript âdocument.getElementsByClassName(âLiveController-action LiveController-actionânextâ, 0)[0].click();â in document 1
endtell
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
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:
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â.
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