Running AppleScripts on Catalina fails with -1743 not authorized error

Our application tries to read the title of the browser, which is then used by the application to carry on further operations. For this purpose application invokes an AppleScript "tell application <browser> to return name of front document".

Mojave added a requirement to include a new NSAppleEventsUsageDescription key in the info.plist file when the application tries to invoke an AppleScript.

But on Catalina, even with the key set in the application's info.plist file, the application is still unable to invoke the AppleScript with the error "-1743 Not authorized to send Apple events to <applicationName>".


Looking at the release notes for the latest Catalina build


"To enhance security, AppleEvents and AppleScripts that target an app on a remote system must authenticate as the same user on the remote system. An AppleEvent that targets an app running as a different user receives a procNotFound error. To allow remote AppleEvents to target apps in any user session, run the following command in Terminal on the server:

defaults write /Library/Preferences/com.apple.AEServer RestrictAccessToUserSession -bool false Then disable and reenable Remote Apple Events in System Preferences > Sharing. (5353592)"


This seems to be the only change documented for AppleScripts. Our application is not trying to run on the remote systems but runs locally. Does the above change apply to all scripts whether they running locally or remotely? Can anyone suggest what can we do to get the AppleScript working?

Have you figured out what this Terminal command is meant to do? I have some basic AppleScripts that Mail Merge with MS Word that are broken under Catalina.

I has the same issue and still work on it...

Hi, have you figured it out... I'm also in the need of same solution
To grant the applescript permission to send events, before notarizing, I had to sign and add an entitlements file.

codesign --sign #{SIGNATURE} --options=runtime --entitlements=script.entitlements #{file}

Then contents of that file is just:

Code Block
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.automation.apple-events</key>
<true/>
</dict>
</plist>

Running AppleScripts on Catalina fails with -1743 not authorized error
 
 
Q