Mojave beta 6 breaks Applescripts

Since updating to beta 6 a numebr of Applescripts fail.

Error message is 'Not authorised to send Apple events to Microsoft Outlook. (-1743)' - helpfu;ly error -1743 is not lsited in teh Applescript documentation.

Cant find a way to authjorise this - a mjor limnitation to m,y workflow!


Any ideas???

That is errAEEventNotPermitted from the Apple Events framework - check your accessibiity permissions in System Preferences. Note that if this is an application, it should be code-signed or otherwise read-only, as scripts modify themselves for persistent properties.

Can't find anything in Accessibility permissions that impacts AppleScript.

The error message includes an 'Edit' button which opens the AppleScrpt editor - clicking run here executes the script as designed...


Strikes me as a bug since this could disable millions of AppleScript routines users have written to automate multiple taska (as I have done)

tested + confirmed! for me it's definitly a bug as well!

If your script is being run as an application, then the application should be added to the accessibility list, but in addition, if it is accessing one of the other applications listed in the Privacy tab (e.g. Contacts), then it would need to be enabled in that list as well. The Script Editor is treated as any other application, so if your script runs from there the Script Editor application would have to be listed/enabled in the accessibility list. If your application is in the accessibility list but runs only once, that would indicate that the script is being allowed to modify itself.

Yes – definitely a change in behaviour with DP6.


Application bundles exported from Script Editor (both signed and unsigned) generate the "Not authorised to send Apple events..." errors if they contain a "tell application 'Finder'..." (or similar) block. I suspect this revolves around the new user data protections coming in Mojave (See WWDC session 702: "Your Apps and the Future of macOS Security".)


Using the "tccutil reset AppleEvents" and "tccutil reset All" commands don't appear to help.


I guess these sorts of app bundles might also need "com.apple.security.scripting-targets" Sandbox entitlements eventually.

did you add your app into accessability?

Yes – no change in behaviour – the same error gets thrown.


Logged in Bug Reporter as issue: 43047400 "Applications exported from Script Editor generate "Not authorised to send Apple events..." errors".

my workaround is, to copy&paste my script into an Xcode-Project and compile it as a Mac-App. On first Launch i must give accessibility permissions. The new App is now in my startup objects and worked fine.

OK, thanks for the feedback; added script to Privacy/Accessibility and it is already listed in the relevant privacy app (Reminders) - same issue - app fails with same error messge; clicking Edit and Run works fine...


I have another two AppleScript Apps that reads from System Events - bothalready listed in Privay/Accessibility but both also fail with same error message but work fine from Edit/Run

Converting Scripts to Apps in Xcode took an hour or so but solved all the permission problems - thanks for the idea!

This doesn't work if the scripts are called from within another application. The application has the access, but the access doesn't pass to the scripts, and the scripts are hard-coded into the application.


mrf

A good illustration of this problem is to run the scheduling module in SuperDuper! Prior to Beta 6, everything ran like clockwork. Beginning with DP6, it won’t run unattended because every time the Copy Job.app gets accessed inside of SD! It requires the user to explicitly grant permission for Apple Events to use Copy Job, Finder to use Copy Job, and SuperDuper! To use copy job. If you don’t respond, the event times out with three errors, all -1712, which relate to system events. There is no way to get around this because there is no way to issue a one-time “sticky” authorization for each job. I have 4 scheduled jobs that runeach night. Every morning I wake up to 12 errors that each have to be dismissed before I can regain control of my desktop. THIS IS TOTALLY UNACCEPTABLE (and I’ve reported it as a bug, which is marked DUPE and closed). All of the security changes may eventually work out, but boy are they a PITA is this release. Wonder what new surprises DP 7 will bring.

I have run into the same issues with Red Sweater's excellent FastScripts. It works on one system requesting a notification to be added to "Automation," but not the other. This works ok with other apps.

I have added it to Accessibility, but that doesn not enter into it.


I have reset the system with tccutil - no change. Turned off SIP, deleted the db, etc. etc.


You should at least be able to add an app manually thy way you can with Accessibility.


Wasted two hours on this to help the poor developer on the other end - we are clueless.

This seeme to be related to Script Editor exports (scripts and Xcode projects still work) - does it do the same thing using Script Debugger or osacompile?

It is related to the originating application needing user permissions. Alas, this is not always getting triggered.

I have same issue


(i have raised a bug report)


I have 100s of installers that I have written in Applescript as .app that are all codesigned and valid. These .apps use the Finder to add my folders (the folder that the customers buy) in to the correct location for use. It currently works on every macOS and worked on the first beta versions of mojave but not the most recent 10.14. beta 6 and gives me this "Not authorized to send Apple events to Finder. (-1743)"


Path: Library/Audio/Apple Loops/Apple/Final Cut Pro Sound Effects


This must be a bug right?

Has anyone tested with Beta 7. I’m installing right now.


mrf

It *might* be fixed in Beta 7. I'm testing with SuperDuper! right now. When it first ran, it asked for Copy Job.app to have permission to access Finder and SuperDuper!, which I granted. Since then, timed events have gone off as scheduled without requiring manual intervention. We'll see if this holds through all of the copy jobs.


mrf

not fixed for me in beta 7 exact same

Correct. All my scripts failed in the same way as in 6.

I cant convert all my scripts to Xcode...i have near 2000. I have many installers that I have written in Applescript as .app that are all codesigned and valid. These .apps use the Finder to do file editing and folder moving as well as System Events to run .pkgs. Now 100% of my scripts that I have saved as .app files dont work. I have tried adding applications like Finder, Script Editor, the .app itself to the "whitelist" in the Security & Privacy like Accessibility, Application Data and no success. I also do not have the option to add anything to the Automation section. All I ever get is this error message when trying to run my .app:

"Not authorized to send Apple events to Finder. (-1743)"

I am on the latest Mojave Beta version 10.14 and if this is something that is intention by Apple how the **** do I fix it?

I sell digital downloads and if this isn't a bug or going to be fixed then this breaks all of my "installers" which is going to cause a huge problem for me. I need to know if this is a bug or if there is going to be a fix becasue this will literally cost me thousands of dollars and all my "installers" will no longer work.

Yes – failed for me in DP7 as well.


I've also uncovered some related Xcode version issues:


If I compile an AppleScript ObjectiveC project with Xcode 8 the resulting app works fine on DP 6 & 7 and prompts the user for AppleEvent permissions the first time it runs and is happy thereafter.


If I compile exactly the same project in the Xcode 10 beta it fails silently on DP 6 & 7 (i.e. no user permissions prompt) and it writes "Not authorised to send AppleEvents to Finder..." errors into the console. (You do get Dark mode support though).


This user data protection stuff definitely needs some more work...

This link pretty well covers the problem and offers suggested ways Apple can fix the problem.


https://www.felix-schwarz.org/blog/2018/06/apple-event-sandboxing-in-macos-mojave

I run my AppleScripts by running Unix-commands like: osascript < AppleScript-file


Here is what I did and what seemed to help me out:


In the Finder select the Go menu -> Go to Folder... type: /usr/bin press: Go

Scroll until you see: osascript


Open: System Preferences

Click: Security & Privacy

Select: Privacy

Open the lock

Click Accessibility, hit the + and then drag osascript from the open Finder-window to the Accessibility area

Click Full Disk Access, hit the + and then drag osascript from the open Finder-window to the Full Disk Access area

Close the lock

didnt work for me :/


still getting: "Not authorized to send Apple events to System Events."

Mojave beta 6 breaks Applescripts
 
 
Q