32
loading...
This website collects cookies to deliver better user experience
define
(this is customizable as well) follow with the word I want to search for. Here is a screenshot on what it looks like when I try to look up the definition for the word amazing
:Enter
, it will actually open up the dictionary app with the word amazing
prefilled to the search field. This does make looking up definitions easier because I no longer have to open up my browser and google for the definitions. But, could it be better?mr-pennyworth
which do just that. I gave the workflow a try, and it did work, but I am not a fan of having to import the dictionaries into HTML files. So, I did not stop here, the search for a better dictionary continues. Unfortunately, I couldn't find any other alternatives that could meet my need, until I learn about Alfred QuickLook. So what QuickLook can do is, if I type in an URL in Alfred search bar, I can then use the default binding Shift/⌘ Y
to toggle a preview of that URL in my default browser.Shift
will open the preview of the definition in any of the online dictionaries I have set. Let's take a quick look at the end result before moving on to the implementation.Shift
to open the preview.require 'json'
dictionary_list = [
{"Oxford Dictionary": "https://www.oxfordlearnersdictionaries.com/definition/english/{query}?q={query}"},
{"Cambridge Dictionary": "https://dictionary.cambridge.org/dictionary/english/{query}"}
]
script_filter_items = []
dictionary_list.each do |hash|
hash.each do |k, v|
script_filter_items.push(title: k, quicklookurl: v)
end
end
puts({ items: script_filter_items }.to_json)
32