Quick fix for any Cursor engineer reading this, please add this flag to the .plist file:
<key>NSAppleEventsUsageDescription</key>
<string>This app requires Apple Events access to automate system functions.</string>
Explanation:
I’m working on an Electron.js app for MacOS that uses AppleScript to get the current website URL from Chrome. However when I launch the app through Cursor’s debugger, the app tries to run the AppleScript and fails with this error
{
NSAppleScriptErrorAppName = "System Events";
NSAppleScriptErrorBriefMessage = "Not authorized to send Apple events to System Events.";
NSAppleScriptErrorMessage = "Not authorized to send Apple events to System Events.";
NSAppleScriptErrorNumber = "-1743";
NSAppleScriptErrorRange = "NSRange: {123, 5}";
}
This is because the app requires certain Mac system permissions. However those permissions can only be asked for if the executing application has flagged they may be needed. Many people developing automation / agents for MacOS will run into this issue eventually.
Please add the two line fix!