I’m looking for a script that would take a text file like:
[code]-g
⌥⌘z: Zoom
⌥⌘u: Check for Updates.
#⌘⎋: Enter Full Screen
Safari
⇧⌘b: Add Bookmark for These Tabs.[/code]
And update global and application specific shortcuts:
defaults write -g NSUserKeyEquivalents '{"Zoom" = "~@z"; "Check for Updates."="~@u";}'
defaults write com.apple.Safari NSUserKeyEquivalents '{"Add Bookmark for These Tabs." = "$@b";}'
Unicode values of special keys, from lri.me/chars:
[code]↑ \UF700 ↓ \UF701 ↠\UF702 → \UF703 F1 \UF704 F35 \UF726
⌦ \UF728 ↖ \UF729 ↘ \UF72B ⇞ \UF72C ⇟ \UF72D ⌧ \UF739ƒhelp \UF746
⇥ \U0009ƒâŒ¤ \U000Aƒâ†© \U000Dƒâ‡¤ \U0019ƒâŽ‹ \U001Bƒâ£ \U0020ƒâŒ« \U007F
↠\U2190ƒâ†‘ \U2191ƒâ†’ \U2192ƒâ†“ \U2193ƒâ£ \U2423ƒâŽ‹ \U2388
⇥ \U21E5ƒ ⇤ \U21E4ƒâ†© \U21A8ƒâŒ¤ƒ\U2324ƒâŒ« \U232BƒâŒ¦ \U2326
⌃ ^ƒâŒ¥ ~ƒâ‡§ $ƒâŒ˜ @[/code]
I’m not fully sure where to start. Has someone made anything similar before? Shell scripting languages are fine as well.