2

Consider the following workflow:

  1. Open TextEdit.
  2. Type a word that's not in the dictionary.
  3. Right-click on that word and select 'Learn Spelling'.
  4. Observe the squiggly underline disappears, as the word is now recognised.
  5. Observe the word is added to the ~/Spelling/LocalDictionary file.
  6. Quit TextEdit.
  7. Remove the word from the ~/Spelling/LocalDictionary file.
  8. Reopen TextEdit.
  9. Type the same word again.
  10. Observe it is still recognised (not squiggly-underlined), despite no longer being in the local dictionary.

It seems the problem here is that there is some sort of cache maintained by macOS that is not refreshed. If I right-click on the word in TextEdit to remove it from the local dictionary instead of editing the file, it is indeed no longer recognised; i.e., this appears to update the cache.

Is there any way I can manually refresh the cache of local dictionary words?

2
  • Is there a reason that using the provided method is not satisfactory? E.g. are you trying to automate changes to the dictionary, or something else?
    – benwiggy
    Feb 1, 2021 at 18:15
  • @benwiggy Mainly that it's a great deal easier to edit the text file. And yes, potentially automation in the future.
    – Noldorin
    Feb 1, 2021 at 18:22

1 Answer 1

4

I figured this out myself in the end. One needs to relaunch the com.apple.applespell service (from the command line).

launchctl stop com.apple.applespell
launchctl start com.apple.applespell

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .