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.
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.
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.
MACRO: [SEARCH] OPEN URL or Search Using Google Chrome
VER: 2.1 2016-09-19 ~~~
[SEARCH] OPEN URL or Search Using Google Chrome.kmmacros (23 KB)
I have been using this macro (or earlier versions of it) many times a day for nearly a year now. I has been one of the greatest time-savers I use.
Using Selection, or Remainder of Paragraph if No Selection
IF Web URL, Open the Web Page in Google Chrome
IF Non-Web URL, …
@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:
Thank you, this was just what I was looking for! One small thing: after pressing the hotkey, a "AppleScript Results" window pops up saying "The output of script "Unknown" is:" Do you know how to prevent this from popping up?
Are you sure you are using my macro? It does NOT contain any AppleScripts.
I'm using the macro "OPEN URL or Search Using Google Chrome", which I believe to be yours, and no other macro's are enabled. The only thing I modified is the SearchURL. I'm using Mojave 10.14.6.
So, here is how to solve problems like this:
In the KM Editor Search box (top right), enter "script" to search for the word "script" in the name of Actions.
The Actions that match this will have blue stripe color
Click on the Execute Script option "display results in a window", and select "ignore results"
I tried the new macro you posted and it works like a charm! For other people who are interested in this time-saving jewel: have a look at
@JMichaelTX's updated macro (1 December 2019)