Running AppleScript from Swift not working
This error occurs if the application is sandboxed.
You have two options:
- Add the
com.apple.security.temporary-exception.apple-events
entitlement forSystem Events
- Put the script in the
Application Scripts
folder of the application and run it from there withNSUserAppleScriptTask