Bookmark words in Apple's dictionary.app

I'm often look up words in Safari to translate them (CTRL-click). Afterwards I'd like to learn them in a vocabulary trainer. But how can I save them in the dictionary.app?

IMAC (RETINA 5K, 27-INCH, LATE 2015), macOS High Sierra (10.13.3), Safari

Posted on Jan 30, 2018 3:21 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 2, 2018 10:48 PM

If you just want to log to a text file a highlighted word looked up via the Dictionary pop-up, one option is to create an Automator service and assign a keyboard shortcut to it. The service will create a text file on your Desktop and append to it. The service offers only basic functionality. The word list created may be useful for importing into a vocabulary trainer, but may require some manual pruning.


1. Create a new Automator service. Leave as is "Service receives selected text in any application". Add the following code to a 'Run AppleScript' action and save the service with a name:


on run {input, parameters}


tell application "System Events"

key code 2 using {control down, command down}

end tell

set filePath to "~/Desktop/dictlog.txt"

set selectedWord to quoted form of (input as string)

try

do shell script "cd; echo " & selectedWord & " >> " & filePath

do shell script "cd; awk '!x[tolower($0)]++' " & filePath & ¬

" > dictlog.tmp && rm " & filePath & " && mv dictlog.tmp " & filePath

end try


end run

User uploaded file

2. Assign a unique keyboard shortcut by navigating to  > System Preferences > Keyboard > Shortcuts > Services. Find the name for the service you created, click "none", then "add shortcut", and press the keys for the desired shortcut.

User uploaded file

3. To use, highlight a word by double-clicking on it or by click-dragging the cursor across it and then use the keyboard shortcut you created. A Dictionary pop-up with a definition if it exists will appear and the word you highlighted for the search will be logged to dictlog.txt on your Desktop. Search words will be deleted automatically from the log as necessary to avoid duplication. If you don't want to log a word looked up, don't use the service you created; use your usual method for the Dictionary pop-up: Control-Command-D, a three finger tap, Control-click, etc.


Only tested on OS X Yosemite 10.10.5. May or may not work with other versions of OS X.

4 replies
Question marked as Top-ranking reply

Feb 2, 2018 10:48 PM in response to maatmax

If you just want to log to a text file a highlighted word looked up via the Dictionary pop-up, one option is to create an Automator service and assign a keyboard shortcut to it. The service will create a text file on your Desktop and append to it. The service offers only basic functionality. The word list created may be useful for importing into a vocabulary trainer, but may require some manual pruning.


1. Create a new Automator service. Leave as is "Service receives selected text in any application". Add the following code to a 'Run AppleScript' action and save the service with a name:


on run {input, parameters}


tell application "System Events"

key code 2 using {control down, command down}

end tell

set filePath to "~/Desktop/dictlog.txt"

set selectedWord to quoted form of (input as string)

try

do shell script "cd; echo " & selectedWord & " >> " & filePath

do shell script "cd; awk '!x[tolower($0)]++' " & filePath & ¬

" > dictlog.tmp && rm " & filePath & " && mv dictlog.tmp " & filePath

end try


end run

User uploaded file

2. Assign a unique keyboard shortcut by navigating to  > System Preferences > Keyboard > Shortcuts > Services. Find the name for the service you created, click "none", then "add shortcut", and press the keys for the desired shortcut.

User uploaded file

3. To use, highlight a word by double-clicking on it or by click-dragging the cursor across it and then use the keyboard shortcut you created. A Dictionary pop-up with a definition if it exists will appear and the word you highlighted for the search will be logged to dictlog.txt on your Desktop. Search words will be deleted automatically from the log as necessary to avoid duplication. If you don't want to log a word looked up, don't use the service you created; use your usual method for the Dictionary pop-up: Control-Command-D, a three finger tap, Control-click, etc.


Only tested on OS X Yosemite 10.10.5. May or may not work with other versions of OS X.

Jan 30, 2018 8:06 AM in response to maatmax

You do not add words to dictionaries in the Dictionary application. The respective dictionaries are pre-compiled by the dictionary developer.


The control-click will look for the selected word in the dictionaries (order) that you have configured in Dictionary application's Preferences, but as Safari is not a word processing or TextEdit application, it does not have the word "learn" feature of those category of applications.


If your vocabulary trainer has its own learn feature, then it will save the selected words in its own proprietary repository, or add them to the text localDictionary file in ~/Library/Spelling folder.

Jan 30, 2018 8:50 AM in response to VikingOSX

Hi VikingOSX, thanks for your answer. I found this: GitHub - pooriaazimi/BetterDictionary: Bookmark words in Apple's Dictionary.app But it's not for High Sierra (and it would not solve my hole problem). It's just a history of looked up words. I do not add words to the dictionary I just want to have an overview which words I did searched/looked up for! And then add this words to a vocabulary trainer (by hand or better automatically)


Maybe there's a similar solution like the git hub extension?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Bookmark words in Apple's dictionary.app

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.