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