Skip to Content

How to Restore Command-D for Don’t Save on Mac Using Terminal Commands

  • This blog article explains on how to restore Command-D for Don’t Save on Mac, which was changed in newer versions of macOS.
  • The article explains how to use terminal commands to change the keyboard shortcut for Don’t Save, as well as how to revert back to the default settings.

If you have been using a Mac for a long time, you may be familiar with the keyboard shortcut Command-D to trigger the Don’t Save button in save dialog windows. This was a convenient way to quickly discard unsaved changes and close a document without using the mouse or trackpad.

However, since macOS Lion, Apple changed this keyboard shortcut to Command-Delete, presumably to make it more intuitive and less prone to accidental clicks. Command-D now sets the save location to the Desktop, which is part of a broader change to the save dialogs in general.

If you don’t like this change and want to restore the old behavior of Command-D for Don’t Save, you can do so with a simple terminal command. In this article, we will show you how to do that, as well as how to revert back to the default settings if you change your mind.

How to Restore Command-D for Don't Save on Mac Using Terminal Commands

How to Restore Command-D for Don’t Save on Mac

To restore Command-D for Don’t Save on Mac, you need to use the Terminal app, which is a command-line interface that lets you execute various commands on your Mac. You can find it in the Applications > Utilities folder, or by using Spotlight search.

Once you launch Terminal, type or paste the following command and press Enter:

defaults write NSGlobalDomain NSSavePanelStandardDesktopShortcutOnly -bool YES

This command tells your Mac to use the standard desktop shortcut only for saving files, which means that Command-D will no longer set the save location to the Desktop, but instead trigger the Don’t Save button.

You may need to quit and reopen any apps that you want this change to take effect on. You can also restart your Mac for good measure.

How to Revert Back to the Default Settings

If you want to go back to the default settings of macOS, where Command-D sets the save location to the Desktop and Command-Delete triggers the Don’t Save button, you can do so by using another terminal command.

Open Terminal again and type or paste the following command and press Enter:

defaults write NSGlobalDomain NSSavePanelStandardDesktopShortcutOnly -bool NO

This command tells your Mac to use both desktop and document shortcuts for saving files, which means that Command-D will set the save location to the Desktop and Command-Delete will trigger the Don’t Save button.

Again, you may need to quit and reopen any apps that you want this change to take effect on, or restart your Mac.

Frequently Asked Questions (FAQs):

Question: What are some other useful keyboard shortcuts for saving files on Mac?

Answer: Some other useful keyboard shortcuts for saving files on Mac are:

  • Command-S: Save the current document.
  • Shift-Command-S: Save the current document as a new file.
  • Option-Command-S: Duplicate the current document and save it as a new file.
  • Command-P: Print the current document.
  • Shift-Command-P: Show a preview of the current document before printing.

Question: How can I create my own keyboard shortcuts for apps on Mac?

Answer: You can create your own keyboard shortcuts for apps on Mac by using System Preferences. Here’s how:

  1. Open System Preferences and click Keyboard.
  2. Click Shortcuts and select App Shortcuts from the sidebar.
  3. Click the + button to add a new shortcut.
  4. Choose an app from the Application menu, or select All Applications if you want the shortcut to work in any app.
  5. Type the exact name of the menu command that you want to assign a shortcut to in the Menu Title field.
  6. Click in the Keyboard Shortcut field and press the keys that you want to use as a shortcut.
  7. Click Add and close System Preferences.

Question: How can I find out what keyboard shortcuts are available in an app?

Answer: You can find out what keyboard shortcuts are available in an app by looking at the app’s menus in the menu bar. Keyboard shortcuts are usually displayed next to the menu commands. You can also use Help > Keyboard Shortcuts or press Shift-Command-/ to see a list of all keyboard shortcuts in an app.

Summary:

In this article, we showed you how to restore Command-D for Don’t Save on Mac, which was changed from Command-D to Command-Delete in newer versions of macOS. We also showed you how to revert back to the default settings if you change your mind. We hope this article was helpful and informative. If you have any questions or feedback, please let us know in the comments below.

Disclaimer: This article is intended for informational purposes only and does not constitute professional advice. We are not affiliated with Apple or any of its products or services. We do not guarantee the accuracy, completeness, or reliability of any information provided in this article. We are not responsible for any damages or losses caused by following or relying on any information in this article. Always consult a qualified professional before making any changes to your Mac or its settings.