Skip to content

Instantly share code, notes, and snippets.

@shmidt
Last active August 29, 2015 14:07
Show Gist options
  • Save shmidt/99c50cbeced33a5ce8c0 to your computer and use it in GitHub Desktop.
Save shmidt/99c50cbeced33a5ce8c0 to your computer and use it in GitHub Desktop.
Shutdown OS X
tell application "System Events"
set ProcNm_ to name of every application process whose visible is true
repeat with i_ from 1 to count items of ProcNm_
set TarProc_ to item i_ of ProcNm_
try
tell application TarProc_ to quit
end try
end repeat
shut down
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment