Cancel a Macro When Typing Text in a Text Field and Then Hitting the "Enter" Key

I have a macro being executed with the hotkey "Enter". I would like to cancel that macro function only when typing text in a type field and it's immediately followed by hitting the "Enter" key. I have tried searching the forum for a solution, but haven't had any luck. Any help is appreciated.

Hey Alex,

You can't do this reliably with any utility available for that Mac that I know of.

Rule-of-the-thumb – never try to use normal typing keys as hotkeys, because you'll always have problems.

There are some special exemptions to this rule. For instance I have several palettes for different contexts that I bring up on demand.


The keystrokes are only available when the palette is open, so I have a visual cue that normal keyboard operation is altered.


Hi Chris,
Originally I created this execution in Apple Script and that's how it is being performed now in KM. I could always implement an "if else" statement in the script.

Thanks, A

My Mac's Keyboard has both an Enter and a Return key. Perhaps you could consider placing the macro on one of them, and leaving the other one unmacro'd. It's not what you asked for, but it's an alternative that might be worth it.