KM & Text Fields

Am I still up to date that KM can't tell (recognize) if the cursor is in a text field or not? Thanks!

The OS -- or, perhaps more correctly, the active application -- doesn't make that information available.

Specific fields are difficult, but you can often infer if any field is active by checking if certain menu items are enabled. Which items will vary by app and editable-field type, but for text fields the Edit menu is a good place to start, e.g. Edit -> Show Spelling and Grammar.

Thanks @Nige_S , I had a look in a few apps to see if the Edit menu changes when the cursor is in a text field or not. Unfortunately that is not the case. Except in Finder "cut" (⌘+x) is only active for text fields. Why am I telling you this? Because this info window drives me crazy, which opens when you press space in non-text fields. Can you please show me how to turn it off? I would also love to use your ready made macro :innocent:

So in a text field space should just be space and in a non text field space should do nothing.

Sorry, correction, depending on whatever, "cut" is not active in a text field either :slightly_frowning_face:

Normally BTT is pretty good at recognizing text fields, but the finder is a pain...

You'll need to be more specific because it is the case in many -- e.g. in Safari and on this site, Edit->Paste is only available when the insertion point is in a text field (a post's edit box or the address bar, for example).

You might be able to do similar to what you show from BTT using AppleScript and System Events, but you'll have the same problem -- if Apple has broken that in the Finder for BTT it'll be broken for everyone...

Are you just trying to block Quicklook in the Finder? I don't know of a way to turn it off, but you might be able to get somewhere with a macro, only enabled when the Finder is frontmost, with "Spacebar" as the hotkey trigger and the only action "Insert text by pasting..." and a space character.

"Quicklook" - So this is the name of my mortal enemy :slightly_smiling_face:

Ok, I'll do a search on the net. Maybe others have this problem too. Thanks @Nige_S

I had a look but saw nothing that works with recent OSs. Here's the macro I did a quick test with -- it'll stop Quicklook from opening if you've a file selected and hit the spacebar in the Finder but will still put a space into e.g. a file name when typing. One gotcha -- in Ventura, at least, it won't put a space into a Spotlight search field...

1 Like

Ah, I misunderstood you and I also misunderstood your macro. I thought it would fill my clipboard history. but it doesn't. And it works perfectly. Vielen Dank :pray:

It does use the clipboard, but KM is smart enough that if the current clipboard is already a space it uses that rather than creating a "new entry". At worst you'll end up with alternating entries of "space" and real data in your history -- if that bothers you add a "Delete Current System Clipboard" action to the end of the macro.

1 Like