To change the shortcut of a service, run plutil -convert xml1 ~/Library/Preferences/pbs.plist
, open the plist, and change for example
<key>(null) - Some Service - runWorkflowAsService</key>
<dict>
<key>key_equivalent</key>
<string>@~a</string>
</dict>
to
<key>(null) - Some Service - runWorkflowAsService</key>
<dict>
<key>key_equivalent</key>
<string>@~</string>
</dict>
Then restart to apply the changes.
@ is command, ~ is option, and  is delete (Windows backspace). Forward delete (Windows delete) would be . The shortcut strings use the same format as in DefaultKeyBinding.dict.
To change a global shortcut set in the App Shortcuts section, run plutil -convert xml1 ~/Library/Preferences/.GlobalPreferences.plist
, open the plist, and change for example
<key>Some Menu Name</key>
<string>~@a</string>
to
<key>Some Menu Name</key>
<string>~@</string>
Then quit and reopen applications to apply the changes.
Application-specific shortcuts are stored in ~/Library/Preferences/*.plist and ~/Library/Containers/*/Data/Library/Preferences/*.plist.
The changes made by the AppleScript are applied for me after I quit and reopen applications. Same for this command:
/usr/libexec/PlistBuddy -c 'Delete NSServicesStatus:"(null) - VimAnywhere - runWorkflowAsService"' ~/Library/Preferences/pbs.plist 2>/dev/null;defaults write pbs NSServicesStatus -dict-add '"(null) - VimAnywhere - runWorkflowAsService"' '{key_equivalent = "~@v";}'
I don't know any way to apply the changes without reopening applications. Running /System/Library/CoreServices/pbs -flush
or terminating pbs
doesn't seem to work.
Best Answer
@chrisKnadler made a good point of using Applescript to do this.
I have used this before in the past but discounted it because of the new problem in Mavericks of preference being cached system wide.
Meaning you could only use the unix command
to get the results to actually change instead of manually changing them or using Applescript plist item commands.
But just now having a look around found a suggestion that you can simply flush the cache and initiate a the system to read the preference again by just calling a
on the plist file you have change. This does indeed seem to work.
You may still need to quite individual apps for them to show the change ( as is normal)
UPDATE: Small change.
Added
> /dev/null
to the end of the defaults command so only errors are returned.