The Super-Secret Mac Keyboard Shortcuts Almost No One Knows About

Beyond the menu bar keyboard shortcuts and the ones you can add in System Preferences, there are a set of keyboard shortcuts called KeyBindings that you can use when writing. These customizable keyboard commands can be used to move around in text, manipuate selections and even insert frequently-used words and phrases.

Some links:
https://ss64.com/osx/syntax-keybindings.html
https://github.com/ttscoff/KeyBindings
https://www.hcs.harvard.edu/~jrus/site/cocoa-text.html
http://www.hcs.harvard.edu/~jrus/Site/selectors.html
https://www.hcs.harvard.edu/~jrus/Site/system-bindings.html

Comments: 10 Responses to “The Super-Secret Mac Keyboard Shortcuts Almost No One Knows About”

    Milo
    3 years ago

    Thank you Gary! That took some work but I have eliminated one tedious bit of typing that I need every day.

    Patricio
    3 years ago

    Very good advice on how to use secret shortcuts. I needed it to save time.
    Thank you Gary

    Henry
    3 years ago

    Hi! Great stuff! Was really exited for this but unfortunately I can't get it to work. My guess is that the commands "insertText" for example, has different names in my Macs system, since I am Norwegian. So the question is, do you (or anyone else) have any clue to where I could find a list of these commands BUT in Norwegian. I tried a lot to swap out my self, but since I´m honestly not sure if this is the problem, or if I made another mistake (I don't think so), I just have so much patience :/

    3 years ago

    Henry: I would assume that the commands are always "insertText" and such, and don't change depending on the language. I would continue to try to look at other causes for the issues. Maybe try one of the very simple examples I show.

    Razvan Mihai
    3 years ago

    Thank you, Gary, for the very well-explained tutorial. I wondered if there are any key binding to change the color of a word or a selection in much the same way as you showed how to change upper/lower case words. I did find something on the topic, but the documentation seems old, and there are no implementation examples.

    https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html

      3 years ago

      Razvan: Doesn't apply here, unfortunately. That's a page for app developers. The part about text color is actually a separate section on that page from the part about key bindings. You can't change the color because key bindings don't affect styling. That would be dependent on the app and how its menus are set up.

    Razvan Mihai
    3 years ago

    Gary: Thanks a lot. I was hoping key binding is the answer to changing the color of a piece of the highlighted text in the Notes app with a simple shortcut instead of manually picking the color with the mouse after pressing Command-Shift-C. I was able to find apple scripts that do this for TextEdit and Pages but couldn't get them to work for Notes, which seems to require more elaborate scripting. https://www.macosxautomation.com/applescript/notes/04.html

    3 years ago

    Razvan: Using Command+Shift+C seems pretty fast to me. I don't know if you will cut that time any more with keyboard shortcut to an Automator action. At best you can save one click, but it may take hours or days to construct something in Automator to do this (depending on your skill level) if it is even possible.

    MacSakki
    2 years ago

    What do I need to use to change a paragraph into a title? “capitaliseWord” does not do the trick.

    2 years ago

    MacSakki: I wouldn't use Key Bindings for that. Use Edit, Transformations in almost any app.

Comments Closed.