Re: Scripting the macOS Spelling Dictionary
Re: Scripting the macOS Spelling Dictionary
- Subject: Re: Scripting the macOS Spelling Dictionary
- From: Shane Stanley <email@hidden>
- Date: Sun, 22 Jan 2017 14:05:17 +1100
On 22 Jan 2017, at 1:43 pm, Christopher Stone <email@hidden> wrote:
Has anyone come up with a means to script adding words to the macOS dictionary in a way the system recognizes without logging-out and back in again?
use AppleScript version "2.4" -- Yosemite (10.10) or later use framework "Foundation" use framework "AppKit" -- for NSSpellChecker use scripting additions
set theWord to "zzounds" set theChecker to current application's NSSpellChecker's sharedSpellChecker() theChecker's learnWord:theWord set knewIt to theChecker's hasLearnedWord:theWord theChecker's unlearnWord:theWord set knowsItNow to theChecker's hasLearnedWord:theWord return {knewIt, knowsItNow}
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden