Spell Checker

I’m looking to check spelling of word or words from a text field either when committed or just be able to turn on “Check Spelling While Typing” from the Edit > Spelling and Grammar menu. Has anyone done any work with this class?

set mispelledRange to current application’s NSSpellChecker’s checkSpellingOfString_startingAt_(myString, 0)