Arrow down (n) times

Curious. Is there a way to insert a variable with a key command? In a recent macro I wanted the selection to arrow down a number of times. Since I continually add to or take away from the amount of lines in the target document, I wanted to give a larger amount of arrow down commands to make sure it got the the bottom of the lines every time. Note that this is not the same in this instance as going to the end of the document.

I ended up duplicating a bunch or arrow down commands in the macro but I was wondering if there wasn’t a more elegant way to do this such as: arrow down (n) times where n = 25.

There is a press and repeat option but I don’t understand what this means as it does not allow setting of how many times to repeat. Perhaps this is used as in, press and repeat (continually until … what?)

Yep, just put the Type Keystroke for the arrow in a Repeat action (KM Wiki) block.

Ah, thanks very much. Not sure what the press repeating keystroke is about then? But very glad you showed me that wrapper. Works great.

You can do this for example:

[test] Press and Repeat.kmmacros (2.0 KB)

OK, so a pause will stop the action. Or, allows it for the duration of the pause when the next action actually stops it. That makes sense. I wasn’t quite sure. Thanks for clearing it up for me.

Yes, the pause allows the keystroke to repeat, because after the pause the macro will finish, so macro finished = no more repeats.

At least that is how it seems to work :wink:

1 Like

Yes, all “press & hold” or “press & repeat” states are released when the macro finishes.

It is basically a safety feature, because “press and hold control key” would basically disable your Mac entirely.

You can do something like:

  • press and hold/repeat key
  • Pause 5 seconds
  • release key
  • other stuff

But the release key would be implicitly done if the macro finishes.