Set cursor inside search box after inserting text

I just wrote a search macro for LinkedIn, and all I want to do is position my cursor inside the quotes. How would I do that?

(I'm guessing it's obvious, but I can't find the right action).

Thanks!36 PM

You’re right. It’s simple:

  • Either use the insertion point token %|% between those quotes, or

  • Add a Left Arrow to the end of the string

I like to use the insertion point token because you don’t have to count arrows if you have a long way to go back.

@mrpasini, I did like this, but it isn't working. What is the right way to do this?39 PM


The insertion point token only works when inserting text via pasting or typing, so it won't work with the Set Safari Field action, since that inserts text programmatically. In this case, I would go with @mrpasini's second suggestion, to add a Left Arrow keystroke after this action:

12 AM

@gglick, I just tried the left arrow keystroke, but that didn’t work. Then I tried just pressing left arrow keystroke manually, and that didn’t work either. I would like to find a way to insert, so would I use a different action than “Set Safari Field” to use the insertion point token?


Yup, in that case, I'd recommend the Focus Safari Field action, and insert the text by pasting, which will let you use the insertion point token:

Keyboard Maestro Actions.kmactions (644 Bytes)
59 AM

That said, if your ultimate goal is to speed up searching LinkedIn, you could use KM to enter the search and then open the search results directly:

Search LinkedIn for Title: Marketing AND Company.kmmacros (2.6 KB)
13 AM

This sample macro presents you with a KM prompt:


Then opens a LinkedIn Search for the terms you enter with the "title: Marketing AND Company “”" part already filled in. I use macros similar to this to speed up searching several different sites. Feel free to ask if you have any other questions!

1 Like

@gglick – I was so excited by what you posted, and then you went ahead and created a macro that is EXACTLY what I wanted to do!

I am grateful. Thank you so much.

Also, now I have a better understanding of variables :blush:

Seriously, though thank you!!!

1 Like

@gglick - How do you figure out the right URL to open?


You’re very welcome. I’m glad to hear my example proved useful :slightly_smiling_face:

Figuring out the right URL to open differs for most sites, but it isn’t difficult. Basically, you just need to perform a search, then look at the resulting search URL to see how it handled your query. In LinkedIn’s case, searching for, say, “epic” results in

You can see that “epic” appears after “keywords=”, and that the “%origin=GLOBAL_SEARCH_HEADER” part was added after the fact and isn’t required, so we now know that the search URL we need to use has to be structured like[QUERY]

So we just have to substitute [QUERY] with the appropriate KM variable or token (making sure to filter it with the Percent Encode for URL action first to make sure the result is a valid URL). Rinse and repeat for other sites :slightly_smiling_face:

1 Like

I can’t get over how useful this will be and how much time I will save. I can’t wait to try this in my CRM app and all these other websites and apps that have required me to click and type into search fields. Thank you so much again!

1 Like

You’re very welcome again :slightly_smiling_face:

One last bonus tip: you’re not restricted to only searching one site per macro. You can also easily add multiple Open URL actions that use the same search term variable to perform a search across multiple sites at once. LinkedIn macro worked perfectly until maybe a week ago. I went to check the new search URL structure, and it went from the fairly simple


It's been awhile since I've made a macro, but any suggestions on how to update the URL?

Hey Robyn,

It looks like the keywords field is still there, just buried amidst all this dreck LinkIn apparently decided to add to their search engine. This modified version of the macro seems to work for me, so hopefully it will work for you too:

Search LinkedIn for Title: Marketing AND Company 1.1.kmmacros (3.5 KB)

Gabe—I so appreciate the quick reply! But it's not working for me. When I type "Melinda Gates" (couldn't think of a good example; forgive me), I get:

In other words, results that don't relate. What do you think may be different on my end?


No problem. If you just want a quick way to search LinkedIn, the easiest thing I can think of to fix this is to get rid of the title: Marketing AND Company "" part, as it doesn't look like the new search engine uses those for anything:

Search LinkedIn.kmmacros (3.2 KB)

But if you still primarily want to search for companies with marketing titles, it looks like this macro and URL will do the trick:

Search LinkedIn for Title: Marketing AND Company 1.1.2.kmmacros (2.4 KB)

These work great, Gabe. Thank you so much again!!!

1 Like