Swift/AppleScript: Cannot run apple script from Swift code
问题 I try to run AppleScript command from Swift code like this: var appleScriptCmd = "tell application \"System Events\" to make login item at end with properties {path:\"" + appPath + "\", hidden:false, name:\"Some App\"}"; var appleScriptCmd2 = "tell application \"System Events\" to set visible of process \"Safari\" to false"; and then I have tried both: let script = NSAppleScript(source: appleScriptCmd2)!; var errorDict : NSDictionary? script.executeAndReturnError(&errorDict) if errorDict !=