Enable Script menu by AppleScript in Catalina

Hello,


the following script stopped working with Catalina. It's result is a timeout. Is there another way to enable the Script menu programmaticly?


tell application id "com.apple.AppleScriptUtility"
    if Script menu enabled is false then
        set Script menu enabled to true
        set application scripts position to top
        set show Computer scripts to false
    end if
end tell

Replies

The AppleScript Utility application is still present at /System/Library/Core Services/AppleScript Utility.app, and you can still open its scripting dictionary by dropping its application icon on Script Editor.


However, if you try to use Script Editor to run any script targeted at AppleScript Utility, it simply runs doing nothing until you get the "AppleEvent timed out" error. This is even true with a simple script that just asks AppleScript Utility for its 'properties'. The same error occurs if you change your script to begin with 'tell application "Script Utility"' instead of using its application id. Scripts addressed to other scriptable applications in the Core Services folder work just fine; for example, System Events and Database Events and, in the Applications subfolder, Folder Actions Setup.


If you try to run the same simple script targeted at AppleScript Utility in Script Debugger, you get a "Connection is invalid" error. The path it is trying to use is given as "MP:System:Library:CoreServices:AppleScript Utility.app". This looks correct, but it doesn't work.


If you use Script Debugger to script other scriptable applications in the Core Services folder, instead, such as Database Events, Script Debugger puts up a '"Script Debugger" wants access to control "Database Events"' dialog on the first attempt, and clicking OK adds Database Events to Script Debugger's list in the Automation pane of System Preferences' Security & Privacy pane Privacy tab, and that allows the script to run repeatedly thereafter. This is correct behavior on Catalina, but it doesn't happen with AppleScript Utility.


My guess is that Apple simply forgot to make Script Utility available to script runners when it split the boot volume into two separate volumes in Catalina. This deserves a bug report to Apple.

you can call an app "Script Menu.app" in the CoreServices-folder for that kind of purpose. I would suggest to launch it with its application id "com.apple.ScriptMenuApp".