Skip to content

Instantly share code, notes, and snippets.

@e0da
Created August 8, 2014 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save e0da/f7d0a083c6a38d16cb36 to your computer and use it in GitHub Desktop.
Save e0da/f7d0a083c6a38d16cb36 to your computer and use it in GitHub Desktop.
function kill_Terminal() {
osascript -e "
try -- I don't care if everything fails
try -- So we can ignore when the timeout fails
with timeout of 0.1 seconds -- So we don't block on the modal
tell application \"Terminal\" to quit
end timeout
end try
tell application \"System Events\" to click UI element \"Close\" of sheet 1 of window 1 of application process \"Terminal\"
end try
"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment