Monday, April 6, 2020

#1 2019-12-25 02:32:17 pm

Marius_Magnificus
Member
Registered: 2019-05-05
Posts: 16

Not authorized to send Apple events to Reminders

I'm trying to automate the creation of a reminder any time I click a particular button
in the small app I am developing using Xcode.

The following code works if it runs as a regular AppleScript from the editor:

tell application "Reminders"
            set newremin to make new reminder
            set name of newremin to "My Reminder"
            set body of newremin to "It's time to wrap up!"
            set due date of newremin to ((current date) + 60)
end tell

But if I include the same snippet in an AppleScript project in the Xcode: AppDelegate file,
when I perfom the above action, the app manages to open 'Reminders' but then I received the following error message:


-[AppDelegate applicationWillFinishLaunching:]: Not authorized to send Apple events to Reminders. (error -1743)

This is what I tried in order to resolve the issue :

Project Format: Xcode 9.3-compatible
macOS Catalina 10.15.2

- In 'info.plist' added the key - value
'NSAppleEventsUsageDescription' -- Privacy - AppleEvents Sending Usage Description

PROJECT SETTINGS
- General:
        Signing:
            Automatically manage signing     --> uncheck
        Signing(Debug):
            Provisioning Profile                   --> none
            Team                                        --> my name (Personal team)
            Signing Certificate                     --> Mac Developer
        Signing(Release):                               --> same as Signing(Debug)

- Capabilities:   
        Hardened Runtime:                           --> ON
            Apple Events:                           --> Check


And after trying the above configuration with no success, I created an executable and went ahead
to Security & Privacy where I allowed the executable in Accesibility, Full Disk Access and Automation but it didn't work out either.

I don't know what else I can try.

I will review the following link with the hope of finding how to correctly set up the app:
https://developer.apple.com/support/xcode/

Any suggestions will be appreciated it.

Model: iMac (21.5-inch, Late 2013)
AppleScript: Xcode 9.3
Browser: Firefox 71.0
Operating System: macOS 10.14

Offline

 

#2 2019-12-25 04:32:34 pm

Shane Stanley
Member
From:: Australia
Registered: 2002-12-07
Posts: 6244

Re: Not authorized to send Apple events to Reminders

You also need to add a NSRemindersUsageDescription string to your Info.plist entries.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/
latenightsw.com

Offline

 

#3 2019-12-25 04:50:12 pm

Marius_Magnificus
Member
Registered: 2019-05-05
Posts: 16

Re: Not authorized to send Apple events to Reminders

It worked!

Thank you so much smile.

I wonder if there is a website, book, resources ... in which one can review the right settings to comply with the security measures that Apple enforce on theirs apps.

Time to continue with my app smile

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)