Skip to content

Instantly share code, notes, and snippets.

@atifazad
Created July 27, 2017 11:19
Show Gist options
  • Save atifazad/a224a4a64821138cfbf8cedbe6afbf52 to your computer and use it in GitHub Desktop.
Save atifazad/a224a4a64821138cfbf8cedbe6afbf52 to your computer and use it in GitHub Desktop.
Python script to close mac apps
import subprocess
import sys
if len(sys.argv) == 1 :
print "missing program name to quit"
else:
program=sys.argv[1]
quitCommand='tell application "' + program + '" to quit'
print "quiting " + program
subprocess.call(['osascript', '-e', quitCommand])
#usage: > python quit.py Skype
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment