Keystroke Macros

I’m a great fan of Scrivener. The design is perfectly aligned with the concept.
I’m a poor typist, and would like a way to correct typing errors quickly with a keystroke macro option: the ability to record a sequence of keystrokes, name the sequence, and then associate the name with a combination of keystrokes. For example, my most common error is switching adjacent letters. In Libre Office, I arranged to exchange the two characters to the right of the cursor with the keystroke Ctrl-z, named SwapChars. The Ctrl-z reproduces the keystorkes SH-RtArr, Ctrl-x, RtArr, Ctrl-v.
Thanks for considering this.

We have no plans to add a macro recording system or scripting language into Scrivener at this time. That’s an awful lot of work for something that tends to already exist in comprehensive form via global tools dedicated toward that purpose. AutoHotKey is the usual recommendation on Windows, and it is not only free but open source. It wouldn’t surprise me one bit if there is already a macro (either built-in or community) for just what you describe.

If you search for AutoHotKey on the forum, you’ll come across a number of threads where tips and tricks are discussed.

Hey, I don’t know if you’ve used AutoHotkey to fix that problem yet. Using code from
jacks-autohotkey-blog [dot] com/2019/09/09/autohotkey-tip-of-the-week-auto-swap-transposed-letters-september-9-2019 makes it pretty easy.

You’ll just have to change the “SendInput {Left}+{Right 2}” line to " SendInput +{Right 2}".

(There’s a bit more to it if you absolutely want to use CTRL+z, since the shortcut in AutoHotkey as shown on the aforementioned page will be global, and not restricted to only Scrivener.)

Good luck.

1 Like

Great tip!

Inserting “#IfWinActive ahk_class Qt5153QWindowIcon” or “#IfWinActive, Scrivener” in the Auto-Execute section at the top of the script will make it Scrivener only. :grin:

Best,
Jim