Cancel Dialog Boxes with a Keyboard Shortcut

If you ever bring up a dialog box by mistake, like pressing Command+s in Safari, or just change your mind after the dialog appears, you don’t have to click the Cancel button to dismiss it. You can use The Esc key or Command+. to dismiss most dialog boxes.