I'm trying to build a simple action that will do the following:
When the user is typing in the omnibar (the hybrid URL and search bar at the top of the window), after the user hits the enter key, I want the omnibar to lose focus. This is the same behavior one experiences in Chrome. This is just a type of behavior I personally strongly prefer and would like to have in Safari.
I've tried to implement this as follows:
This doesn't work however:
- The action seems to capture hitting the "enter" key in any text field in any website, in addition to the omnibar, but I want it to only respond when the enter key is pressed in the omnibar.
- The second issue is that I do want the enter key to register and to be passed through to the application so that the webpage is loaded. Is this expected? Is there any way to "pass through" an enter key without it feeding recursively back into BTT?
Anything else I might be doing wrong, or any other guidance on how I could get this working?
Thanks in advance for any help.
I wonder, which macOS version are you running? Because on my machines (macOS 13.4.1) Safari's Omnibar looses focus just fine when pressing enter.
Thanks for the reply.
I wonder, which macOS version are you running?
I'm running 13.4.1 (c) (22F770820d).
Because on my machines (macOS 13.4.1) Safari's Omnibar looses focus just fine when pressing enter.
Interesting, now that I'm trying it again, enter is working and I don't think is stuck in an infinite loop anymore.
A secondary issue I'm having is that I want this action to apply only when I'm hitting enter when in the Omnibar. However, this is getting triggered whenever I hit enter anywhere in Safari (within a Google Doc, for example). Do I have the action triggers configured correctly? It's supposed to be set to only apply when
focused_element_details CONTAINS "\"WEB_BROWSER_ADDRESS_AND_SEARCH_FIELD\"" is true, but perhaps I'm misunderstanding how these triggers actually work.
Thanks again for the help with this. Really appreciate it.
Your condition looks good, however due to their nature, advanced trigger conditions will also block the keyboard shortcut if the condition is not true.
If you want to keep the default enter key working outside of the omibox, you will need to setup an additional trigger that has the negated property and "forwards" the enter key: