Why does text window require 2 returns to disappear?

Hello,
I wrote the following macro to display Scrivener shortcuts.
I am curious why it requires 2 not one Returns to close the text window.
thanks very much


Apparently it has something to do with the nature of how KM displays the window. Perhaps @peternlewis can clarify.

IAC, I have found that one ESC key press will dismiss the window.

1 Like

The text field is selected initially.

1 Like

Esc is the solution. thanks very much

thank you Peter.
what is the difference between clicking I like and clicking the heart ?

I'm not certain, but I think you are just mistaking "1 like" (ie, "one like") and the heart. On your own posts, it does not show the heart because you can't "like" your own posts.

Clicking on the "N likes" will show you who liked the post.

Clicking on the heart will say that you like the post and add one to the tally (or unlike/remove one if you had already "liked" it).

1 Like

thanks

To make the OK button respond to the first press of Return you can add this script after the Display Text action:

# tell application "Keyboard Maestro Engine" to activate # Needed when another app is frontmost
tell application "System Events"
  tell application process "Keyboard Maestro Engine"
    tell window "Keyboard Maestro - Display Text"
      tell button "OK"
        set focused to true
      end tell
    end tell
  end tell
end tell

For example:

[test] Focus OK Button of Display Text Window.kmmacros (3.2 KB)


If another app is pushed to the foreground after the Display Text action, then you have to activate (=uncomment) the first line. Example:

1 Like

works perfectly
thank you so much Tom !!

Peter, is there some reason you can't set the initial focus to the "OK" button?
I think this is the behavior that most of us would expect.

Probably. The field is selected so you can copy the message.

Maybe it’s just me, but that seems like the least likely action the user would want to take. AFAIK, all other Mac popup windows that have an enabled OK button accept RETURN as a click on the button.

If you think a lot of users would want to copy the text, then you could provide a “Copy” button. :wink:

Whether or not the need for pressing Return twice is changed, what confuses me is that the button has the solid-color appearance of a default button, and by that visual cue I anticipate pressing Return once to be all that’s necessary. If the button appearance were changed that would, in turn, counter my expected result from pressing Return once.

While I would prefer pressing Return just once over a change in the button appearance, I’m not confident about what would be the best change (if any) for the majority of users.

Hey Folks,

I thought we covered this issue ad nauseam a while back.

I believe this is the way that sort of window widget works, and it is not an exclusive feature of Keyboard Maestro.

Enter (not Return) will dismiss the dialog immediately – as will (Escape).

Personally I prefer the way it works now, because I frequently want to copy the text — and I don’t want to fool with a Copy button.

works just fine for me.

-Chris

1 Like

I guess I was out sick that day. LOL

Really? Clicking on COPY button, or using a shortcut of "C" for it would be much faster (1/2 the keystrokes) than select ALL, then CMD-C.

But if that floats your boat, then fine. :wink:

Regardless, with the OK button enabled/highlighted, as in , it gives the (false) appearance that it has the focus, and that a normal RETURN will "click" the button.

Done for the next version.

The text is still selected, Command-A,Command-C will still copy it, but pressing return/escape/enter will close the window.

4 Likes