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

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.

This worked for me, but it requires converting to an app first!


1. Open the app's plist file is xcode

2. add row (from right click context menu)

3. in ‘key’ column select ‘Privacy - AppleEvents Sending Usage Description’ from the drop down menu (you need to scroll down)

4. add ‘This script needs to control other applications to run.' in the value column.

5. Build the application again... it should now prompt for accessibility and automation permissions.


Hope it helps...

This also worked for me but because of the way in which my application invokes AppleScript I did not have to convert the script to an application.

This isn't going to work for me as I generate my AppleScript's from a shell-script and then simply use osascript to execute it.

Thank you @RalphyT!!!!


Your answer worked for me! You saved me a lot of grief after hours of combing through forum threads!


I created an account, just to thank you, so thank you again!

Mojave beta 6 breaks Applescripts
 
 
Q