Have you ever closed an application after hitting CMD-Q
by mistake? I have, way too many times.
At some point I decided to address this issue and create the following
AppleScript, which runs on CMD-Q
thanks to keyboard remapping via
BetterTouchTools.
The script displays a simple warning and quit the application on confirmation.
- Open AppleScript
- Past the code below
- Save as
~/.quit_front_app.scpt
- Run
osascript ~/.quit_front_app.scpt
- There is no 5
tell application "System Events"
set frontApp to name of first application process whose frontmost is true
display dialog "Quit?"
end tell
tell application frontApp to quit