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???

Replies

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."

The developer resolved it. He needed to use a more recent SDK and stop targeting Leopard/Snoe Leopad.

Sorry...


Just realized I still 'pull' my osascript commands through ssh...


So, instead of doing like: osascript < AppleScript-file

I do: ssh -x localhost 'osascript < AppleScript-file'

my script now works as it did with beta 8

We had to add NSAppleEventsUsageDescription string to our application's plist file to get around the errAEEventNotPermitted error. After adding this string to the plist we now get the prompt to allow control and the application and target app get added to the automation section of the security and privacy preference pane.

I have now tested exporting the same AppleScript from Script Editor 2.11 (203) on 10.14 beta 10 (18A384a) and this appears to produce an application bundle that will prompt for user permissions when run on the same Mojave beta.


I can see that the exported app bundle's info.plist includes these keys which do not appear in versions exported from previous Mojave betas (<= 7):


<key>NSAppleEventsUsageDescription</key>

<string>This script needs to control other applications to run.</string>

<key>NSAppleMusicUsageDescription</key>

<string>This script needs access to your music to run.</string>

<key>NSCalendarsUsageDescription</key>

<string>This script needs access to your calendars to run.</string>

<key>NSCameraUsageDescription</key>

<string>This script needs access to your camera to run.</string>

<key>NSContactsUsageDescription</key>

<string>This script needs access to your contacts to run.</string>

<key>NSHomeKitUsageDescription</key>

<string>This script needs access to your HomeKit Home to run.</string>

<key>NSMicrophoneUsageDescription</key>

<string>This script needs access to your microphone to run.</string>

<key>NSPhotoLibraryUsageDescription</key>

<string>This script needs access to your photos to run.</string>

<key>NSRemindersUsageDescription</key>

<string>This script needs access to your reminders to run.</string>

<key>NSSiriUsageDescription</key>

<string>This script needs access to Siri to run.</string>

<key>NSSystemAdministrationUsageDescription</key>

<string>This script needs access to administer this system to run.</string>


I wonder if these keys can be manually edited/reduced to just the capabilities that will match the expected functionality requirements of the script/app bundle?


The recent beta 10 (& possibly the untested 8 & 9) looks like it has resolved the main issues with no permissions prompt that would allow the user to let the script proceeed.