Set variable with selected text and append to defined search URL

safari
search
variables

#1

I want to take some of the tedium out of a specific search I am performing. I want to select text then hit the macro which will take the text and insert it into a url and then open a new Safari window and insert the URL and perform the search.

example URL:
https://www.example.com/search/top/?q=My_Selected_Text

I assume I need to use a variable to store the selected text. Can someone get me started on this or point me to a post that nails it.


#2

John,

Take a look at the below macro I just posted.
It is set to use Google Chrome and Google Search, but it can easily be changed to Safari and whatever search engine you prefer.


#3

@JMichaelTX has nailed this one with his ubermacro, but just to give you some building blocks for future problem solving…

You could do something like this:

Or something like this:


Copy then paste it into a url