Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Is there a bash or applescript to look up a word in /Applications/Dictionary.app from a Terminal window ?

open -a /Applications/Dictionary.app/ --args word

ignores --args, says "type a word to look up"

Mac Dictionary improvements suggests ⌃ Control ⌘ Command D however I'm looking to launch the full app, not just the small popover.

share|improve this question
Instead of the "more" button you just click the dictionary's name in the pop-up to open the search in the dictionary application. –  gentmatt Apr 29 '13 at 10:58
Thanks everybody, there's_more_than_one_way_to_skin_a_cat –  denis Apr 29 '13 at 12:29

4 Answers 4

up vote 10 down vote accepted

You can use...

open dict://my_word

...which will open the Dictionary application and lookup the string my_word. If you want to use multiple words use something like open dict://"Big Bang Theory".

There's no output in the Terminal though.

share|improve this answer
Thanks. Is there a list of open magicprefix:... someplace ? –  denis Apr 29 '13 at 11:16
@Denis I don't know of a source that specifically collects undocumented command options for open. But generally speaking, hints.macworld.com is a well known source for hidden gems. I also used to know a different source which collects undocumented defaults write commands, but I can't remember it just know and Google did not help me either... –  gentmatt Apr 29 '13 at 11:37
I made a brief summary of open on SuperUser a while ago superuser.com/questions/4368/os-x-equivalent-of-windows-run-box/… –  David Pearce Apr 30 '13 at 12:16
@denis the system maintains a database of all the prefixes that all the apps installed have told it how to handle. If you can think of a practical use for knowing that tidbit, asking a full question would be awesome. –  bmike May 5 '13 at 14:12

Using the Python Objective-C bindings, you could create just a small python script to get it from the built in OS X Dictionary. Here's a post that details this script"


import sys
from DictionaryServices import *

def main():
        searchword = sys.argv[1].decode('utf-8')
    except IndexError:
        errmsg = 'You did not enter any terms to look up in the Dictionary.'
        print errmsg
    wordrange = (0, len(searchword))
    dictresult = DCSCopyTextDefinition(None, searchword, wordrange)
    if not dictresult:
        errmsg = "'%s' not found in Dictionary." % (searchword)
        print errmsg.encode('utf-8')
        print dictresult.encode('utf-8')

if __name__ == '__main__':

Save that to dict.py, and then just run python dict.py dictation

enter image description here

Check out the post for more instructions on making it accessable all across your terminal.

share|improve this answer
I used this script, but there is no line break in the output, it looks like this: i.imgur.com/ooAwQCA.png (on an OS X 10.9). –  hyh Mar 23 at 19:23

I was also going to suggest open dict://word, but Google's dictionary API also uses the New Oxford American Dictionary:

#!/usr/bin/env ruby

require "open-uri"
require "json"
require "cgi"

ARGV.each { |word|
  response = open("http://www.google.com/dictionary/json?callback=dict_api.callbacks.id100&q=#{CGI.escape(word)}&sl=en&tl=en&restrict=pr,de").read
  results = JSON.parse(response.sub(/dict_api.callbacks.id100\(/, "").sub(/,200,null\)$/, ""))
  next unless results["primaries"]
  results["primaries"][0]["entries"].select { |e| e["type"] == "meaning" }.each { |entry|
    puts word + ": " + entry["terms"][0]["text"].gsub(/x3c\/?(em|i|b)x3e/, "").gsub("x27", "'")
share|improve this answer

I came across this post looking for a similar thing. Wasn't happy with the options available so made simple script. Its a terminal based thesaurus with text to speech. May be of interest ...


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.