How to make a simple 'make highlighted text' lowercase macro?

I tried searching in the system preferences, perhaps such an action is already there but couldn't find a hotkey for that in there.

All I want it is if I was selecting some text, like so :

If I pressed a hotkey, it would transform it to :

I think it should be really simple to do but it would be incredibly useful for me.

It says in here : http://www.mac-forums.com/switcher-hangout/256664-keyboard-shortcut-changing-sh-f3.html

That Command-Option-C should work but that doesn't work for me :frowning:

1 Like

Oh wow, TIL I learned about Filter Clipboard action. Thank you for that.

There are a number of text transformations and other tools that are part of OS X. Here’s a short article:
http://www.macworld.com/article/2104521/the-secrets-of-os-xs-text-tools.html .
These are not universal, but are good to know. Peter’s macro-in-the-making will work wherever you can edit text (afaik).

1 Like

Hey Nikita,

The forum you reference is talking about Microsoft Word 2011.

Both C and A function as advertised in Word.

-Chris

Hey ccstone,

Yeah, my bad, just noticed that. Should be more careful.

You may not need KM at all for things like this. Emacs-like keybindings are built in to Cocoa text editor UI — lowercase is ⌥l… See Cocoa Text System - Default System Key Bindingss (There are plenty of similar pages on the web — I just did a quick search to find this one.)

Moreover, you can change or add keybindings. (See DefaultKeyBinding.dict for complete documentation and an example of customization.)

The key (hmmm, pun) piece of information you need to know is that the keybindings are stored in the text file

/System/Library/Frameworks/AppKit.framework/Resources/StandardKeyBinding.dict

You can override the bindings defined there by copying that file to

~/Library/KeyBindings/DefaultKeyBinding.dict

and making desired changes. (You need to exit an application and reopen it for the changes to take effect.) Note that bindings can execute several NS actions. Note also that some bindings are easily customized because they are already in the file, just commented out.

This is truly ancient DNA from the earliest NextStep system, as derived from standard Emacs — and so command-line — keybindings. In fact, if you use ⌥f, ⌥b, ⌥d, etc. on the command-line you are already using these bindings. (Though shells have their own mechanisms for defining these — they don’t use the above files.)

The base meta-key on OSX is ^ (Control) rather than (Option).

Some commands are ⌃ and some are ⌥. For example ⌃f is forward-char and ⌥.f is forward-word.

Sorry, I should have given ⌃key examples.

Where do you get your modifier images? I think in some places I would prefer using those to the standard glyphs. Maybe we could have a palette of those similar to the Menu Glyphs.group from the Library.

Hey Mitchell,

That's just markdown:

<kbd>⌘</kbd><kbd>⌥</kbd><kbd>F</kbd>

Gives:

F

-Chris

1 Like

Well that’s cool! Didn’t know about that one.

I am going to provide a guide to the most commonly used built-in Cocoa text keybindings, but for now I want to point out a particular use of the built-in keybindings

The keystrokes that delete text — ⌃K, ⌥D, and ⌥⌫ in particular — accumulate that text on a clipboard separate from the OS X clipboard and, ⌃Y inserts that clipboard’s text.

There are four big advantages for using these keys (and for the first advantage, the same holds true for others of the keystrokes buiilt-in to Cocoa text editors):

  1. Cocoa text key bindings are much quicker to use than the mouse, or even arrow key combinations.

  2. Many of the Cocoa keybindings don’t have regular OS X equivalents.

  3. The secondary clipboard accumulates text deletions; pasting that text back can then be done with a single keystroke, rather than a series of keystrokes or mouse clicks with the KM Maestro clipboard history.

  4. It is very convenient to have a second clipboard that is used with these short-term commands — it doesn’t disturb the current clipboard (although that is far more important without KM’s clipboard history).

d is not a normal Cocoa keybinding.

It normally produces the character: ∂

D produces the character: Î

-Chris

Testing in TextEdit and TextWrangler, none of those keystrokes worked as you indicated, except for ⌥⌫

In particular, ⌃Y just pastes the current clipboard, not the "deleted text" clipboard you refer to.

Personally, I wouldn’t expect a programming editor to conform to those things - they need as many hotkeys as possible. Just my opinion, though.

TextEdit works with ^K and ^Y. So does Mail.

FWIW. YMMV.

Strange, just tested TextEdit again, and these don't work for me.
It is possible that I have those keys set as hotkeys somewhere, but I don't recognize them for TextEdit.

EDIT: Yep, I have hot keys for both of those. My apologies for the confusion.

User error. g,d&r

:stuck_out_tongue:

K works fine in both TextEdit and TextWrangler.

However TextWrangler (and BBEdit) do not support the secondary pasteboard.

Y Yank (paste from secondary pasteboard)

A Go to beginning of paragraph.
E Go to end of paragraph.
K Kill (delete) to end of paragraph and add to Yank buffer.
F Forward one character.
B Backward one character.
F Forward one word.
B Backward one word.

There are a bunch of them that work in Cocoa applications and in OSX text fields.

-Chris

You can't run fast enough to avoid the Texas lasso. LOL

LOL. That reminds me of my friend who was a CHP officer. He would say “You can’t outrun the Motorola Overdrive” (radio).

1 Like