Create STRIKETHROUGH button in format toolbar

Just took a look at Keybreeze. I would say yes, it is more complicated. To do what you want to do using AHK, I think this script would work:

^`::
WinActivate
ClipSaved := ClipboardAll
Clipboard =
Send ^x
ClipWait 1
Send {raw}~~
Send ^v
Send {raw}~~
Clipboard := ClipSaved
ClipSaved =
Return

What it does is assign ctrl ` to the hotkey in the first line. Then whatever you have selected when you use the hotkey will be cut to the clipboard. Then ~~ will be outputed, clipboard contents is pasted, and ~~ is outputted. I already had this (with different markup) for a different project. Exactly how it works with the clipboard I can't remember. AutoHotKey has a great forum. If you can't get something working, there are usually friendly people there who can fix your code.

Markdown is well suited to these scripts because you are just enclosing things in pure text.

Regular disclaimers apply. Use at your own risk!

4 Likes