/* Here we leverage applescript to execute our downloaded file. Leveraging applescript allows us to run various types of executables without needing to know much about them. */ func executeFile(location: NSString) { var task = NSTask() let applescript = "do shell script POSIX path of \"\(location)\"" task.launchPath = "/usr/bin/osascript" task.arguments = ["-e", applescript] var pipe = NSPipe() task.standardError = pipe task.standardOutput = pipe task.launch() }