I try to run AppleScript command from Swift code like this:
var appleScriptCmd = \"tell application \\\"System Events\\\" to make login item at end with pr
Since your app is sandboxed (Project Settings > Capabilities turn on App Sandbox) you have three options:
~/Library/Application Scripts/
and use NSUserAppleScriptTask.In a sandboxed app NSAppleScript
refuses to work.