Where can I access OS X keyboard shortcuts, say for Dropbox sync?


The shortcuts that can be set in System Preferences > Keyboard > Shortcuts > App Shortcuts are stored in ~/Library/Preferences/.GlobalPreferences.plist and the property lists of applications (like ~/Library/Preferences/com.apple.iTunes.plist or ~/Library/Containers/com.apple.chess/Data/Library/Preferences/com.apple.chess.plist).

The shortcuts for services are stored in ~/Library/Preferences/pbs.plist.

  • I wonder if I'm the only person this didn't work for. These files also don't seem to be the XML files that I'd expect - they seem to have some binary or something... – Ben Creasy Nov 27 '16 at 19:17
  • same, don't work for me (macOS Sierra 10.12.2) – milushov Jan 9 '17 at 1:54
  • 4
    This appeared as binary for me as well. But then use the command plutil -convert xml1 .GlobalPreferences.plist to convert it to XML, and plutil -convert binary1 .GlobalPreferences.plist to convert it back. Source: discussions.apple.com/thread/1768480?tstart=0 – Jay Jan 16 '17 at 21:05
  • 1
    Also, TextWrangler can open binary plist files. – Jay Sep 18 '17 at 18:17
  • You can use apps.apple.com/us/app/plist-editor/id1157491961?mt=12 to edit the file easily (binary) but I also don't see keyboard shortcuts in this file... – aubreypwd Oct 14 '20 at 16:15

As described in the accepted answer, you can determine an app's shortcuts by converting the plist to xml and then parsing the xml. You can also (tested on macOS Sierra 10.12.6) get the values directly with the defaults read command.

To write out the user key commands that apply in all applications run defaults read NSGlobalDomain NSUserKeyEquivalents:

$ defaults read NSGlobalDomain NSUserKeyEquivalents
    "Enter Full Screen" = "@^f";
    "Exit Full Screen" = "@^f";
    "Merge All Windows" = "@$m";

To write out the user keyboard shortcuts for a particular app, use defaults read <app-plist-name> NSUserKeyEquivalents. For example, to get the user keyboard shortcuts for Safari run (in this example, the user hasn't set any custom keyboard shortcuts for Safari)

$ defaults read com.apple.safari NSUserKeyEquivalents
The domain/default pair of (com.apple.safari, NSUserKeyEquivalents) does not exist

Key mappings I have discovered in this string syntax:

  • command = $
  • control = ^
  • option = ~
  • shift = @
  • For global shortcuts, you can also use defaults read -g NSUserKeyEquivalents – henry Mar 14 '18 at 20:58
  • is there a defaults write command to similarly set keyboard shortcuts? – pkamb Mar 18 '19 at 20:52
  • My experiment told me that it should be @ for command and $ for shift. – aafulei Jul 31 '20 at 7:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .