Repeating a Keystroke at Fixed Time Intervals

I need a macro that will press the "Return" every 2 seconds 7,000 times.

Can anyone help?

Hello! Welcome to one of the best places on the entire internet. Have you tried creating a macro to do that but are getting stuck on a particular step? Generally we try to help folks learn how to fish so I'll post some links that @ccstone usually posts that are really helpful for getting started.

If you haven't seen these they're worth a moment of your time:

2 Likes

Hi @Julii_House. Welcome to the Keyboard Maestro forum.

@MikeTheClicker provided some great resources!

In general, I agree with @MikeTheClicker's statement (notwithstanding my kids' constant frustration when I'd take that approach with their homework :grinning:), but I also know that Keyboard Maestro can be overwhelming for new users. In most cases, I've found that specific examples can be helpful. Below I've provided a macro that you can review, try, ask questions about, and then modify to suit your needs.

@Julii_House, in the example macro, I assumed that you'd only want the return/delay iterations for a specific application. As written TextEdit is the application. You'll no doubt want to change that. See the embedded comments (magenta) and parameters (orange).

DOWNLOAD Macro File:
Repeat Return+Delay.kmmacros (35 KB)
Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.

Macro-image


@Julii_House, in the above macro, and almost all others, you'll see that Variables are used in the fields of Actions. This seems simple, but there are some details that can trip up new users.

If you read the Macro Actions wiki page you'll see:

Keyboard Maestro actions have two very distinct types of fields: text token fields and numeric calculation fields. You can learn more on the wiki Text Fields page.

Fortunately the Keyboard Maestro editor displays the field type when the field is entered.

If the indication is a C, variables can be added as is:

If the indication is a T, variables require the Variable token:

See the Text and Numeric Fields wiki page for much more information.

3 Likes