Help for Url Search Macro

Hello, I'm new to keyboard maestro and I need help with a url search macro. I'm on KM version 11.0.2 at the moment.

What I need to the macro to do:

  1. Take a word that I copy to the clipboard
  2. Take this url
  3. Add the copied word to the url like so: word (without the space)
  4. Add #sanskrit to that url after the word like so: word#sanskrit (without the space)
  5. Open a Safari tab with the complete url like this example: jnati#sanskrit (without the space)

I added a space after /definition to avoid it becoming a link, sorry if that's confusing. I think this might be very simple for many of you but I tried a few things and I couldn't make the macro read other instructions and add them with a "movable" part in between. That was my problem. This is very important to my workflow since I'm currently working on a sanskrit translation for a book and any help with the macro would save me so many hours of manually typing the word then clicking the saskrit link or scrolling down, etc.

I sincerely would appreciate the help, thank you!

You can do this with a two-action macro:

Build and open URL.kmmacros (1.6 KB)

Note that you can actually do it all in a one-step macro: You can build the URL in the "Open Safari Tab" step with the same structure as I used in the variable. I wasn't sure of your needs, though, and a variable may provide more flexibility.


The answer you provided works great! Thank you so much!
I'm curious about the Safari Tab option. Right now I have a sanskrit text I'm translating so when I need to check a dictionary I copy the word and check but I would like to add more steps, for example make Safari translate to spanish after opening the url. Would this option be easier to achieve with the "open safari tab" alternative?

By the Safari Tab option, I just meant that the variable step is unnecessary: You can copy and paste the text from the variable set action into the Safari Tab action, and then you wouldn't need the variable.

As for doing anything once the page is open, that would depend on what you do "in real life" to take those actions: How do you translate the page into Spanish?


I'm just using the built in Safari translate option to do it. The thing is the variable saves me time because sometimes I need to open many dictionary tabs to check for context meaning between them so once I have like 6-10 tabs I quickly switch between them to get the correct meaning of the word in the context of the sentences.
While I'm working I have my documento on one screen, then I copy a word and hit your macro, copy the next worth and repeat. This already saves me a lot of time and clicking around. Do you think there is a better way for my needs?

Sounds like you're doing it the right way (though I think it'd work the same without the variable).

For the translation, you could add a Select or Show a Menu Item action, and point it to the translation option you want to use.


great Idea! I tried the Select or Show a Menu Item action, but it's not consistently working. Do I need to add anything in between?

Wisdomlib translation.kmmacros (2.3 KB)

You might have to add this before the Menu action: