I haven't run across this before, so I thought I'd share.
Here's a simple command for looking up the current word in Dictionary.app:
osascript &>/dev/null \ -e 'with timeout of 30 seconds' \ -e 'tell application "Dictionary"' \ -e 'activate' \ -e 'end tell' \ -e 'end timeout' \ -e 'do shell script "open dict:///$TM_CURRENT_WORD"' &
We can't just do the shell script because, for whatever reason, it only works if Dictionary.app is already open. Without the "Timeout" argument applescript will not wait for Dictionary.app to open before requesting the definition.
I'm sure there are better ways to code this, but it works for me.
--oliver
Oliver wrote:
I haven't run across this before, so I thought I'd share. Here's a simple command for looking up the current word in Dictionary.app:
Does this have any advantage over the system-provided combination of control-command-D (which works with or without a selection). This key combo pops up a mini-window with a brief definition, and provides a "More..." button should you wish to open the full definition in Dictionary.app.
Cheers, Paul