I'm trying to write a program that adds some new services to the Mac.

For this to work I need to add keyboard shortcuts to some installed services. Doing it though system preferences is not an option.

I need a command line operation that will let me map a keyboard shortcut to user created service.


1 Answer 1


The service shortcuts are stored in pbs.plist and can be modified like this:

/usr/libexec/PlistBuddy -c 'Delete NSServicesStatus:"(null) - \
  servicename - runWorkflowAsService"' ~/Library/Preferences/pbs.plist 2>/dev/null
defaults write pbs NSServicesStatus -dict-add '"(null) - \
  servicename - runWorkflowAsService"' \
  '{key_equivalent = "^~@1";}'

Source: https://apple.stackexchange.com/users/3936/

^ = control, ~ = alt, @ = command; replace servicename with the name of the service

You must log in to answer this question.

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