Use KM to toggle between 2 different menu item options

I want to create a shortcut in the Mac Notes app to toggle changing the case of some text. If I set the macro to trigger on shift-ctrl-U I want it to toggle between the Notes menu ... Edit-Transformations-Make Upper Case and Edit-Transformations-Make Lower Case. How can I do this to toggle between upper case and lower case with hitting just this one shortcut?

How's this work for you?

Toggle Notes Case Macro (v10.2)

Toggle Notes Case.kmmacros (5.7 KB)

1 Like

Hi, @loz. The following macro toggles the case with Notes on Ventura. I've not tested with other versions of macOS. Also,

  1. During my testing with Notes, the change will be made for a word if the text cursor is within or immediately after a word (i.e., the word does not have to be selected). This is the same behavior you would see if you were selecting the menu items manually.

  2. As written, the macro would work with other apps if they had the same menu options.

  3. The current state is saved to a dictionary rather than a global variable. I prefer that method to avoid clutter in the Variables pane of the Keyboard Maestro Settings (aka Preferences).

Download: Toggle Case in Notes.kmmacros (26 KB)

Macro-Image


Macro-Notes
  • Macros are always disabled when imported into the Keyboard Maestro Editor.
    • The user must ensure the macro is enabled.
    • The user must also ensure the macro's parent macro-group is enabled.

System Information
  • macOS 13.4 (22F66)
  • Keyboard Maestro v10.2

These both work well thank you very much. Also has given me a bit of insight how stuff like this needs to be done :slight_smile:

1 Like

Here's another option to toggle the case of selected text in any app. It will consider text that contains any lower case letters as lower case.

Toggle Text Case (Filter).kmmacros (40 KB)

Macro screenshot

1 Like