node-auto-launch
node-auto-launch copied to clipboard
AppleScript security issues on macOS Mojave
- The target platform(s) the problem occurs on (Linux, Mac, Mac App Store, and or Windows): macOS Mojave 10.14.5
- Node version (run
node -v
): 10.15.0 - auto-launch version: 5.0.5
- The options you're passing to auto-launch:
{
name: 'xxx',
isHidden: true,
mac: {
useLaunchAgent: false // default value
}
}
- Are you using NW.js or Electron?
- Yes: Electron
- If you're using Electron, are you using auto-launch from the main process or a renderer process? -> main process
Since the Mojave version of macOS, Apple introduced some advanced security features which prevent auto-launch to execute its AppleScript.
The Exception "Not authorized to send Apple events to System Events" is thrown when calling autoLaunch.enable()
.
Here is an example: https://recatch.io/s/UnDGITjNmLYV
Is there any workaround? I prefer to use the AppelScript method so my app appears in the Login Items menu, which is not the case with LaunchAgent.
Thank you,
If I add the Apple Events entitlement https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_automation_apple-events and notarize my app then it works for me.
Hello,
I also have this issue, any way of making it work without notarizing the app ?
Thanks
My app is notarized and I have the permission set, but we're still getting this error.
<key>com.apple.security.automation.apple-events</key>
<true/>