Isn't sandboxing applications wonderful! I read some descriptions on Apple developer site, and it sounds like in beta 6 and 7 these issues started to occur. There were some suggestions to save the AppleScript file as a App and then go into the info.plist to indicate that the application needs access to other applications. Though perhaps that issue was resolved before the final release. It sounds in general like the complete automation framework that Apple has had in place for the entire life of OsX has been restricted and the framework is fairly vague at how to correct. This Sandboxing has the potential of limiting the flexibility of OsX automations much as it has always been with IOS. For Apps that provide shortcuts to hundreds of applications apparently each application that the shortcut utility wants to work with has to be separately authorized.
This below sounds interesting: https://forums.developer.apple.com/thread/108815 <https://forums.developer.apple.com/thread/108815> Not authorized to send Apple events to Mail 352 Views1 Reply <> <> latency <https://forums.developer.apple.com/people/latency>Sep 21, 2018 6:35 AM I have a simple Swift-based macOS app that creates and executes an Apple Script: let unreadEmailsScript = """ tell application "Mail" get unread count of inbox end tell """ if let scriptObject = NSAppleScript(source: unreadEmailsScript) { var errorDict: NSDictionary? = nil scriptObject.executeAndReturnError(&errorDict) if let error = errorDict { print(error) } } I've added the following to my project's entitlements: <key>com.apple.security.temporary-exception.apple-events</key> <array> <string>com.apple.Mail</string> </array> When I execute this on the latest version (18A389) of Mojave the code prints: { NSAppleScriptErrorAppName = Mail; NSAppleScriptErrorBriefMessage = "Not authorized to send Apple events to Mail."; NSAppleScriptErrorMessage = "Not authorized to send Apple events to Mail."; NSAppleScriptErrorNumber = "-1743"; NSAppleScriptErrorRange = "NSRange: {33, 12}"; } The system doesn't prompt me for authorization at app launch. What is the correct way to send Apple Events to Mail via a Swift app under Mojave? TIA Correct Answer by latency <https://forums.developer.apple.com/people/latency> on Sep 22, 2018 5:36 AM In case anyone else runs into this problem... what solved it for me was this the following. I added <key>NSAppleEventsUsageDescription</key> <string>Please give Unread Mail access to Mail via Apple Script.</string> to my app's plist. Now, upon first launch, the system prompts the user for permission. If permission is granted the app's Apple Script works correctly. <https://forums.developer.apple.com/thread/108815#332158> Best wishes, Jonathan Cohn > On Sep 29, 2018, at 1:51 PM, M. Taylor <[email protected]> wrote: > > Hello Robert, > > Give the following steps a try: > > 1. > Open System Preferences. > > 2. > Select the security and privacy icon. > > 3. > Select the Privacy Tab. > > 4. > Select accessibility from the categories table. > > Now, explore the items in the list and see if there are any items to which > you can activate by placing a checkmark. > > You may first need to unlock the system. > > Good luck, > > Mark > > From: [email protected] > [mailto:[email protected]] On Behalf Of Robert Carter > Sent: Saturday, September 29, 2018 6:27 AM > To: [email protected] > Subject: Re: Mojave VoiceOver and keyboard commander > > Hi, > > My problem is that I said no to allowing SCROD to run a system event. When I > set up Mojave. That was a mistake and I am trying to find out how to go back > in and tell Mojave yes it can allow SCROD to run a system event. Does anybody > know how I would do that? > > Robert Carter > > > > > On Sep 29, 2018, at 5:58 AM, gerrycook <[email protected]> wrote: > > Hi robert i reported this to apple the other day because by chance, i did > right option t and i was given a message to allow SCROD as a system event and > when i did this time and date worked as it did before.. It must be Mojave i > believe you can find the path to it in cor services in system library. > cheers gerry have a nice day > Email: [email protected] > Skype: gerry.cook1 > Twitter: @gerrycook52 > > > On 29 Sep 2018, at 11:20 am, Robert Carter <[email protected]> wrote: > > Hi, > > After updating to Mojave, Neither of the keyboard commander commands that use > apple scripts works for me. These are the option plus t and option plus u > commands. I have allowed VoiceOver to use apple script checked. I have reset > my VoiceOver preferences to their defaults and none of this made the speaking > of the time and date start working. Has anybody else seen this? > > Thanks, > > Robert Carter > > > -- > The following information is important for all members of the Mac Visionaries > list. > > If you have any questions or concerns about the running of this list, or if > you feel that a member's post is inappropriate, please contact the owners or > moderators directly rather than posting on the list itself. > > Your Mac Visionaries list moderator is Mark Taylor. You can reach mark at: > [email protected] and your owner is Cara Quinn - you can reach Cara at > [email protected] > > The archives for this list can be searched at: > http://www.mail-archive.com/[email protected]/ > --- > You received this message because you are subscribed to the Google Groups > "MacVisionaries" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/macvisionaries. > For more options, visit https://groups.google.com/d/optout. > > > -- > The following information is important for all members of the Mac Visionaries > list. > > If you have any questions or concerns about the running of this list, or if > you feel that a member's post is inappropriate, please contact the owners or > moderators directly rather than posting on the list itself. > > Your Mac Visionaries list moderator is Mark Taylor. You can reach mark at: > [email protected] and your owner is Cara Quinn - you can reach Cara at > [email protected] > > The archives for this list can be searched at: > http://www.mail-archive.com/[email protected]/ > --- > You received this message because you are subscribed to the Google Groups > "MacVisionaries" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/macvisionaries. > For more options, visit https://groups.google.com/d/optout. > > -- > The following information is important for all members of the Mac Visionaries > list. > > If you have any questions or concerns about the running of this list, or if > you feel that a member's post is inappropriate, please contact the owners or > moderators directly rather than posting on the list itself. > > Your Mac Visionaries list moderator is Mark Taylor. You can reach mark at: > [email protected] and your owner is Cara Quinn - you can reach Cara at > [email protected] > > The archives for this list can be searched at: > http://www.mail-archive.com/[email protected]/ > --- > You received this message because you are subscribed to the Google Groups > "MacVisionaries" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/macvisionaries. > For more options, visit https://groups.google.com/d/optout. > > -- > The following information is important for all members of the Mac Visionaries > list. > > If you have any questions or concerns about the running of this list, or if > you feel that a member's post is inappropriate, please contact the owners or > moderators directly rather than posting on the list itself. > > Your Mac Visionaries list moderator is Mark Taylor. You can reach mark at: > [email protected] and your owner is Cara Quinn - you can reach Cara at > [email protected] > > The archives for this list can be searched at: > http://www.mail-archive.com/[email protected]/ > --- > You received this message because you are subscribed to the Google Groups > "MacVisionaries" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at https://groups.google.com/group/macvisionaries. > For more options, visit https://groups.google.com/d/optout. -- The following information is important for all members of the Mac Visionaries list. If you have any questions or concerns about the running of this list, or if you feel that a member's post is inappropriate, please contact the owners or moderators directly rather than posting on the list itself. Your Mac Visionaries list moderator is Mark Taylor. You can reach mark at: [email protected] and your owner is Cara Quinn - you can reach Cara at [email protected] The archives for this list can be searched at: http://www.mail-archive.com/[email protected]/ --- You received this message because you are subscribed to the Google Groups "MacVisionaries" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/macvisionaries. For more options, visit https://groups.google.com/d/optout.
