Strikethrough with Text Edit

Probably a simple enough question, trying to make a keybaord shortcut in TextEdit for Strikethrough

I can make it in Keyboard in System Settings, but can't figure out how to do it with Keyboard Maestro:

CleanShot 2023-04-05 at 21.30.12

CleanShot 2023-04-05 at 21.30.32

Could anyone point me in the right direction?

A menu is something that appears on the menubar at the top of the screen - so what you have there is not a menu and so KM can't use it with it's in-built action.

A quick google led me to this AppleScript Apply strikethrough style to selected text irrespective of application - #4 by KniazidisR - AppleScript | Mac OS X - MacScripter

When I ran this in Script Debugger (or Script Editor) it worked fine.

Here's my test macro for you to play with:

Download Macro(s): Test Struck Through.kmmacros (2.8 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 10.14.6
  • Keyboard Maestro v10.2
2 Likes

I use KM to make all format changes. Strikethrough looks like this.

5 Likes

Thank you!

Brilliant, that works perfectly :slight_smile:

It would be cool if this strikethrough macro could work as a toggle, i.e. switching strikethrough style on and off.

This would require a If-Else-Conditional and the ability to detect the styling properties of the text contained in the system clipboard. The latter isn't yet possible, or is it?

Yes, I toggle, but with another app. But KM can certainly do that too.

I don't think so, it's just a matter of alternating between two actions.

If the "cycle" starts with strikethrough, but the text is already strikethrough, then I trigger the shortcut again. It's not perfect, but it's enough for me. :slightly_smiling_face:

1 Like