AppleScript名:ASOCでスペルチェック |
— Created 2015-12-09 14:52:51 +0900 by Takaaki Naganoya — 2015 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "AppKit" set aStr to current application’s NSString’s stringWithString:"This is a pen." set aChecker to current application’s NSSpellChecker’s sharedSpellChecker() –’s setLanguage:"en_US") –’s checkSpellingOfString:aStr startingAt:0 aChecker’s setLanguage:"English" aChecker’s checkSpellingOfString:aStr startingAt:0 |
カテゴリー: Spellchecker
システムスペルチェック辞書への学習と削除
AppleScript名:システムスペルチェック辞書への学習と削除 |
— Created 2017-01-22 by Shane Stanley use AppleScript version "2.4" use framework "Foundation" use framework "AppKit" use scripting additions –http://piyocast.com/as/archives/4635 –スペルチェック辞書への学習 set theWord to "piyomaru" set theChecker to current application’s NSSpellChecker’s sharedSpellChecker() theChecker’s learnWord:theWord set knewIt to theChecker’s hasLearnedWord:theWord –> true –スペルチェック辞書からの削除 theChecker’s unlearnWord:theWord set knowsItNow to theChecker’s hasLearnedWord:theWord return {knewIt, knowsItNow} –> {true, false} |
ロシア語(ru)のシステムスペルチェック辞書を指定して学習
AppleScript名:ロシア語(ru)のシステムスペルチェック辞書を指定して学習 |
— Created 2017-05-12 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use framework "Foundation" use framework "AppKit" use scripting additions –http://piyocast.com/as/archives/4635 set theChecker to current application’s NSSpellChecker’s sharedSpellChecker() set langList to (theChecker’s availableLanguages()) as list –> {"en", "en_GB", "en_CA", "en_IN", "en_SG", "en_AU", "en_JP", "fr", "da", "de", "es", "it", "nl", "nb", "pl", "pt_BR", "pt_PT", "fi", "sv", "tr", "ru", "ko"} set curCheckerLang to (theChecker’s |language|()) as string –> "en_GB" set aWord to "Su-35" theChecker’s setLanguage:"ru" theChecker’s learnWord:aWord set knewIt to theChecker’s hasLearnedWord:aWord –> true set curCheckerLang to (theChecker’s |language|()) as string –> "ru" |