Detect if in a text field, don't trigger command?

Hey @hello,

This sort of thing gets very problematic when you are trying to have the keys perform normally in text fields.

You can make System Events send a keystroke:

tell application "System Events"
   keystroke "n"
end tell

I'll be surprised if you can make this work smoothly enough to satisfy, but you never know.

In any case – take a look at this:

Single-Key macros

This is how I manage single-key hotkeys when I want them.

-Chris