34 Replies
      Latest reply on Mar 12, 2019 3:30 PM by MrMattCO1991
      JMaynard Level 1 Level 1 (0 points)

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

        • Re: Mojave beta 6 breaks Applescripts
          red_menace Level 3 Level 3 (105 points)

          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.

            • Re: Mojave beta 6 breaks Applescripts
              JMaynard Level 1 Level 1 (0 points)

              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)

                • Re: Mojave beta 6 breaks Applescripts
                  red_menace Level 3 Level 3 (105 points)

                  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.

                    • Re: Mojave beta 6 breaks Applescripts
                      JMaynard Level 1 Level 1 (0 points)

                      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

                • Re: Mojave beta 6 breaks Applescripts
                  Jooo Level 1 Level 1 (0 points)

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

                    • Re: Mojave beta 6 breaks Applescripts
                      David Westcott Level 1 Level 1 (0 points)

                      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.

                        • Re: Mojave beta 6 breaks Applescripts
                          cjadams Level 1 Level 1 (0 points)

                          did you add your app into accessability?

                            • Re: Mojave beta 6 breaks Applescripts
                              David Westcott Level 1 Level 1 (0 points)

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

                                • Re: Mojave beta 6 breaks Applescripts
                                  Tweak Level 1 Level 1 (10 points)

                                  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.

                                    • Re: Mojave beta 6 breaks Applescripts
                                      JMaynard Level 1 Level 1 (0 points)

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

                                      • Re: Mojave beta 6 breaks Applescripts
                                        Mrfearless Level 1 Level 1 (0 points)

                                        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

                                          • Re: Mojave beta 6 breaks Applescripts
                                            Mrfearless Level 1 Level 1 (0 points)

                                            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.

                                          • Re: Mojave beta 6 breaks Applescripts
                                            Eseyee Level 1 Level 1 (0 points)

                                            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. 

                                  • Re: Mojave beta 6 breaks Applescripts
                                    HStriepe Level 1 Level 1 (10 points)

                                    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.

                                    • Re: Mojave beta 6 breaks Applescripts
                                      michael1979 Level 1 Level 1 (0 points)

                                      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?

                                      • Re: Mojave beta 6 breaks Applescripts
                                        Adam van Gaalen Level 1 Level 1 (0 points)

                                        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

                                        • Re: Mojave beta 6 breaks Applescripts
                                          dtaggart Level 1 Level 1 (0 points)

                                          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.

                                            • Re: Mojave beta 6 breaks Applescripts
                                              David Westcott Level 1 Level 1 (0 points)

                                              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.

                                            • Re: Mojave beta 6 breaks Applescripts
                                              RalphyT Level 1 Level 1 (0 points)

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