Click Safari text field

I'm trying to click the search field in Safari circled in pink in the attached. I've a lot of different 'search for image' and 'click at x and y' without success. Also tried using tab to select it, which doesn't work either. Any other way to get Keyboard Maestro to move cursor to text field?

If it's always in the same location on the screen, or relative to the window, you can just click in the x/y position.

I would also think you could target an image of that part, although you may need to narrow down the rectangle to search within.

Perhaps
image

or the sort button next to it?

1 Like

It isn't always in same position. It moves up and down slightly, depending on whether there are other tabs open.

Tried numerous parts of the screen for images including the magnifying glass and sort button, but Keyboard Maestro unable to find on screen.

1 Like

Try the following in the menu bar for Safari:

Safari > View > :heavy_check_mark: Always show tab bar

Use a JavaScript action. In this case:

image

...should work.

JS code for completeness:

document.querySelector("input[name='query']").focus()
1 Like