Is it possible to make a macro that, for example, repeats the next macro you run by a keyboard shortcut twice? I want to implement an Emacs argument for my keyboard editing shortcuts. Ideally, it would work the following way:
I press control+u and a digit N (I'm OK with defining 8 macros manually for the purpose for digits 2-9), preferably without having to press enter in an input window
I run any other macro by keyboard shortcut
that macro is run N times in total
I understand this is an extremely tall order, so I would be also interested in more basic ways to set up ways to move or kill 2 or 3 words and such.
They do not. I have two dozen macros that implement Emacs text editing shortcuts — macOS has some of them out of the box but those versions do not work in a Cyrillic keyboard layout or in MS Office apps. For the most part they just perform either a single action: option+f to option+right arrow
or a short sequence of actions: option+t selects word to the left, cuts it to a private clipboard, moves cursor one word left, pastes the word to transpose words.
I am extremely attached to these shortcuts and being able to dispose of Karabiner Elements and its gigantic JSON which was required to set up exceptions etc was a great benefit of starting to use Keyboard Maestro.
I already maintain two sets of these shortcuts (MS Office often needs adjustments in more complex motions), so I would not mind making a third set which accepts an argument. I've attached the macro sets that I want to be repeatable — I do not need to apply this to arbitrary macros. Emacs (MS Office) and Other Macros.kmmacros (194.8 KB)
And then we would have to find a way to solve the other half of your problem, which is to specify a number and choose one of those macro. I think I can probably solve that too.
Easiest way is to set up a "number catcher" macro, enabled by your ⌃U-triggered macro, that appends any number typed to a global variable or uses ESC to cancel and reset. The problem is telling that macro when to stop capturing... You could build that into your other macros.