Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / appnap.swift
Created March 3, 2018 21:59
import AppKit
// https://stackoverflow.com/a/48486247
func shell(_ launchPath: String, _ arguments: [String]) -> String {
let task = Process()
task.launchPath = launchPath
task.arguments = arguments
let pipe = Pipe()
task.standardOutput = pipe