Macros for looking up words

Hi all.
I am brand new to Keyboard Maestro and I have no problem making the simple macros, but now, after 3 days of searching the web, I am hoping to get some help in here.

I am trying to make macros that let me look up any word that I mark, in a document or on the web in general, in various dictionaries, thesaurus, google translate etc.

There probably is a lot suggestions already here, but I can’t seem to find them, and when I find them I don’t understand what to do or how to “copy” them.
Anyone got time to guide a newbie?

1 Like

Hey Mona,

Take a look at some of these:

https://forum.keyboardmaestro.com/search?q=search%20web

If you still have problems then report back.

-Chris

2 Likes

Here's a variation of a sample macro I just made for Search a number of sites with user prompted search term, which had a similar question:

[Example] Copy Selected Text and Search Multiple Sites.kmmacros (2.0 KB)

The main difference with this version is that it will automatically copy any text you have selected and use that for the search term rather than prompting you to enter the search term yourself. Once you understand how this macro works, it should just be a matter of modifying/adding more "Open URL" actions for all of the sites you want to search. As Chris says, if you still find yourself running into problems, feel free to ask any further questions!

1 Like

You may, or may not, actually need a macro.
Have you tried using the services built-in to your Mac?

  1. Select a word or phrase, and right-click on it, and then click on "Look up ..."
  1. Now you will see various options, with the "Dictionary" selected.
    .

.
3. Now click on "Open in Dictionary", and you will see even more options:

Here is a simple macro that automates the right-click on whatever your mouse is hovering over, then goes to the top of the menu. You can choose the menu item by pressing the SPACE bar, or move to other items with the arrow keys. You may, or may not, find this more useful than just manually right-clicking on the select text. I wish there was a way to invoke the right-click context menu for the selected text without using the mouse.

and don't forget you can always run the macOS Spotlight search, which will first search your local drive for any kind of document (notice the Evernote documents in my example) whose name or body contains the text. Then you will see external sources like Wikipedia.

If none of those give you what you want then you could run a macro like the one @gglick suggested.

OR

See SearchLink - BrettTerpstra.com for a very interesting and useful tool.

4 Likes

@JMichaelTX is, as usual, very right: macOS's built-in Dictionary app and lookup functions are highly useful, and in my experience, a great first stop when looking up terms before moving on to searching websites (your mileage may vary, of course). To expand on what he's shared, here are a few tidbits of info regarding them that may or may not be common knowledge:

There may not be a way to invoke the context menu without the mouse, but it is possible to invoke the lookup popup without it: just press ⌃⌘D in any Mac app that uses "native" text fields while text is selected. For Magic Trackpad users, you can also use either a three-finger tap or a Force Click while the cursor is over a word, without needing to select it first (check the Trackpad settings in System Preferences; you can configure which to use as the first option in the "Point & Click" section).

If you know you want to look up a word in the built-in Dictionary app, or if you're using apps that don't support native lookup (like Microsoft Office) you can of course make a macro for that which works anywhere. Here's one I've used for years:

When using Dictionary, you can configure the sources it shows and their order:


And you can switch between them with either ⇧⌘{ and ⇧⌘}, or the command key and the number of the source's order (for example, in my configuration, ⌘0 switches to All, ⌘3 switches to English, and ⌘5 to Wikipedia).

4 Likes

LaunchBar can be easily configured to allow one to search for a selected word in the OS X dictionary, Google, and other places, using only the keyboard:
Double-tap {shift}, d, {enter}
Double-tap {shift}, g, {enter}

These use the Launchbar features “Modifier Tap”, “Double Tap”, “Instant Send”, and “Send to”. On my machine, Launchbar has been taught that “d” means the Dictionary application, and that “g” means Google’s search page.

Note that sending a single word to Google search will almost always bring up a panel showing the definition and pronunciation at the top of the page (unless the word you search for is “dictionary” or “definition” — in which case the panel is a mini-dictionary search, and shows you words you recently looked up).

The OS X Dictionary application’s Preference pane allows one to select among the several reference works available for use.

2 Likes

Thanks Kirby, that works well.
One question: Can I make LB spell check the word?

One nice thing about the right-click is that I get either:

  • IF misspelled: Spelling suggestions
    OR
  • IF spelled correctly, "Lookup in Dictionary"

Can I get something like that from the LB process?

2 Likes

OK, this looks cool, what I was looking for:
[LB6 Action] Lookup in Dictionary.app with Live Feedback - Objective Development Forums

Anyone used this custom action?

2 Likes

No, but it does indeed look spiffy.

-Chris

2 Likes

Yep, it is. I've installed it and really like it. My new spellcheck/lookup tool!

Once you have selected the desired word in LB, you can then either paste it back your app, or open the Dictionary using it.

⇧+Enter to paste the selected word in the frontmost application.
⌃+Enter to pass the exact query to Dictionary.app

4 Likes

I’m stumped. Is there a lbaction file? How did you install the action?

1 Like

Yep. Go here:
LaunchBar Custom Action -- Live search in Dictionary.app

Download the Dictionary.Live-1.2.0.lbaction, and then just double-click on it.

3 Likes

Thank you! Learned what a “Release” is :blush: .

1 Like

Thank you all so very much for your help and guidance. I have managed to make myself a really cool search palette. So now I am ready to take on the world of searching :wink:

2 Likes

Hi there,

I always used this LaunchBar action, but LaunchBar is no longer reliable for me (keeps crashing, don't know why).

I'd love to recreate this action in Keyboard Maestro. Is it possible?