Set service keyboard shortcut and have change take effect programtically
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.