React to a Dialog Window if It Pops Up; Continue Otherwise

I'm a newbie and so far have only done simple keyboard macros. Now I'm trying something more sophisticated. The workflow is this:

  1. Send a keystroke on a key trigger
  2. Wait for a couple of secs
  3. If a dialog box opens up with a certain text in the window, choose an option by sending arrow down and return. (The dialog usually does not appear at all.)
  4. End after 2 secs, regardless of what happens

If 2. does not block that is even better.

I have no idea if this is something that can be done by KM or even if MacOS allows it.

My other question is can I detect when I'm in a text input field? I have a PC keyboard and sometimes pressing home/end in a text field goes to begin/end of line as expected and sometimes it scrolls the window? It's very odd behavior. If I can detect when I'm in a text field, I want to send cmd+left/cmd+right when home/end is pressed.

Thank you in advance for any help

To your first question:

Use a Pause Until action that waits for a button or front window title. Give it a timeout via the gear icon (top-right).

To your second:

KM can't tell if you're in a text field. If the field is populated by text, you can string some actions together that will determine this, but it's not unobtrusive.

2 Likes

Thank you very much! Your suggestion for #1 (wait for button) works perfectly. For #2, I guess I need to retrain my muscle memory :slight_smile:

1 Like