defaults write com.apple.Safari NSUserKeyEquivalents \
'{"bookmarkName"="keys";}'
...where bookmarkname is the name you've given the bookmark, and keys is one or more of the following...
- @ = Command
- $ = Shift
- ~ = Option
- ^ = Control
defaults write com.apple.Safari NSUserKeyEquivalents '{"MacOSXhints"="@~x";}'
You can create as many shortcuts as you want at one time just by duplicating the code within the braces. The example below will create two shortcuts, one to Apple site's bookmark (Command-Shift-A) and one to macosxhints' bookmark (Command-Option-X):
defaults write com.apple.Safari NSUserKeyEquivalents '{"MacOSXhints"="@~x";"Macworld"="@$a";}'
[robg adds: This is a nice timesaver over trekking through the Keyboard Shortcuts panel in the Keyboard & Mouse System Preferences panel. I'm pretty sure this should work in both 10.3 and 10.4, but I haven't tested it in 10.3.]

