Answers:
当您按下“学习”按钮时,~/Library/Spelling/LocalDictionary如果将语言设置为“自动”或~/Library/Spelling/en将语言设置为“美国英语” ,则会添加该单词。en_GB用于英国英语,en仅用于美国英语。
如果~/Library/Spelling/直接编辑文件,则可以通过终止AppleSpell过程来应用更改。
因此,尝试为脚本分配快捷方式,如下所示:
cd ~/Library/Spelling
if [[ -e fiction ]]; then
mv en normal; mv fiction en; d=fiction
else
mv en fiction; mv normal en; d=normal
fi
killall AppleSpell
terminal-notifier -title "Using dictionary $d" -message '' -group spellingdictionary
sleep 3
terminal-notifier -remove spellingdictionary
例如,如果您使用英式英语词典,请更改en为en_GB。
您可以安装terminal-notifier使用sudo /usr/bin/gem install terminal-notifier。