Platforms to show: All Mac Windows Linux Cross-Platform
NSSpellCheckerMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The NSSpellChecker object is used by a client (e.g. a document in an application) to spell-check a given String.
There is only one NSSpellChecker instance per application (since spell-checking is interactive and you only have one mouse and one keyboard).
The string being spell-checked need only be valid for the duration of the call to checkSpellingOfString or countWordsInString.
Requires Mac OS X 10.2.
- 5 events
- event Correct
- event FindNext
- event Ignore
- event requestCandidatesForSelectedRangeCompleted(sequenceNumber as Integer, candidates() as NSTextCheckingResultMBS, stringToCheck as String, selectedRange as NSRangeMBS, checkingTypes as Int64, options as Dictionary, tag as Variant)
- event requestCheckingOfStringCompleted(sequenceNumber as Integer, results() as NSTextCheckingResultMBS, orthography as NSOrthographyMBS, wordCount as Integer, stringToCheck as String, Range as NSRangeMBS, checkingTypes as Int64, options as Dictionary, tag as Variant)
- 10 properties
- property accessoryView as NSViewMBS
- property automaticallyIdentifiesLanguages as boolean
- property Handle as Integer
- property language as string
- property Length as Integer
- property Location as Integer
- property substitutionsPanel as NSPanelMBS
- property substitutionsPanelAccessoryViewController as NSViewControllerMBS
- property Tag as Integer
- property WordFieldValue as string
- 36 methods
- method availableLanguages as string()
- method checkGrammarOfString(text as string, start as Integer, language as string, wrap as boolean) as NSRangeMBS
- method checkGrammarOfString(text as string, start as Integer, language as string, wrap as boolean, Details() as dictionary) as NSRangeMBS
- method checkSpellingOfString(text as string, start as Integer) as NSRangeMBS
- method checkSpellingOfString(text as string, start as Integer, language as string, wrap as boolean) as NSRangeMBS
- method checkSpellingOfString(text as string, start as Integer, language as string, wrap as boolean, byref WordCount as Integer) as NSRangeMBS
- method checkString(text as string, range as NSRangeMBS = nil, checkingTypes as Int64 = -1, options as Dictionary = nil, byref orthography as NSOrthographyMBS, byref wordCount as Integer) as NSTextCheckingResultMBS()
- method completionsForPartialWordRange(start as Integer, length as Integer, text as string, language as string="") as string()
- method correctionForWordRange(range as NSRangeMBS, text as string, language as string) as string
- method countWordsInString(word as string, language as string="") as Integer
- method deletesAutospaceBetweenString(precedingString as string, followingString as string, language as String = "") as Boolean
- method dismissCorrectionIndicatorForView(view as NSViewMBS)
- method forgetWord(word as string)
- method guessesForWord(range as NSRangeMBS, word as string, language as string) as string()
- method guessesForWord(word as string) as string()
- method hasLearnedWord(word as string) as boolean
- method ignoredWords as string()
- method ignoreWord(word as string)
- method languageForWordRange(range as NSRangeMBS, text as string, orthography as NSOrthographyMBS = nil) as string
- method languageMenuEntries as string()
- method learnWord(word as string)
- method menuForResult(TextCheckingResult as NSTextCheckingResultMBS, checkedString as string, options as Dictionary = nil, atLocation as NSPointMBS, view as NSViewMBS) as NSMenuMBS
- method preventsAutocorrectionBeforeString(text as string, language as String = "") as Boolean
- method recordResponse(response as Integer, correction as string, word as string, language as String = "")
- method requestCandidatesForSelectedRange(selectedRange as NSRangeMBS, stringToCheck as string, types as Int64 = -1, options as Dictionary = nil, tag as Variant = nil) as Integer
- method requestCheckingOfString(stringToCheck as string, range as NSRangeMBS, types as Int64 = -1, options as Dictionary = nil, tag as Variant = nil) as Integer
- method setIgnoredWords(words() as string)
- method setLanguage(language as string) as boolean
- method spellingPanel as NSPanelMBS
- method unlearnWord(word as string)
- method updatePanels
- method updateSpellingPanelWithGrammarString(lang as string, detail as dictionary)
- method updateSpellingPanelWithMisspelledWord(word as string)
- method userPreferredLanguages as string()
- method userQuotesArrayForLanguage(lang as string) as string()
- method userReplacementsDictionary as dictionary
- 25 shared methods
- shared method isAutomaticCapitalizationEnabled as boolean
- shared method isAutomaticDashSubstitutionEnabled as boolean
- shared method isAutomaticPeriodSubstitutionEnabled as boolean
- shared method isAutomaticQuoteSubstitutionEnabled as boolean
- shared method isAutomaticSpellingCorrectionEnabled as boolean
- shared method isAutomaticTextCompletionEnabled as boolean
- shared method isAutomaticTextReplacementEnabled as boolean
- shared method NSSpellCheckerDidChangeAutomaticCapitalizationNotification as string
- shared method NSSpellCheckerDidChangeAutomaticDashSubstitutionNotification as string
- shared method NSSpellCheckerDidChangeAutomaticPeriodSubstitutionNotification as string
- shared method NSSpellCheckerDidChangeAutomaticQuoteSubstitutionNotification as string
- shared method NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification as string
- shared method NSSpellCheckerDidChangeAutomaticTextCompletionNotification as string
- shared method NSSpellCheckerDidChangeAutomaticTextReplacementNotification as string
- shared method NSTextCheckingDocumentAuthorKey as string
- shared method NSTextCheckingDocumentTitleKey as string
- shared method NSTextCheckingDocumentURLKey as string
- shared method NSTextCheckingOrthographyKey as string
- shared method NSTextCheckingQuotesKey as string
- shared method NSTextCheckingReferenceDateKey as string
- shared method NSTextCheckingReferenceTimeZoneKey as string
- shared method NSTextCheckingRegularExpressionsKey as string
- shared method NSTextCheckingReplacementsKey as string
- shared method NSTextCheckingSelectedRangeKey as string
- shared method sharedSpellCheckerExists as boolean
- 12 constants
Constants
Constant | Value | Description |
---|---|---|
NSGrammarCorrections | "NSGrammarCorrections" | One of the key constants for the dictionaries in the details array. |
NSGrammarRange | "NSGrammarRange" | One of the key constants for the dictionaries in the details array. |
NSGrammarUserDescription | "NSGrammarUserDescription" | One of the key constants for the dictionaries in the details array. |
Correction indicator type Constants
Constant | Value | Description |
---|---|---|
NSCorrectionIndicatorTypeDefault | 0 |
The default indicator that shows a proposed correction. Available in Mac OS X v10.7 and later. |
NSCorrectionIndicatorTypeGuesses | 2 |
Shows multiple alternatives from which the user may choose the appropriate spelling. Available in Mac OS X v10.7 and later. |
NSCorrectionIndicatorTypeReversion | 1 |
Provides the option to revert to the original form after a correction has been made. Available in Mac OS X v10.7 and later. |
Response Constants
Constant | Value | Description |
---|---|---|
NSCorrectionResponseAccepted | 1 |
The user accepted the correction. Available in Mac OS X v10.7 and later. |
NSCorrectionResponseEdited | 4 |
After the correction was accepted, the user edited the corrected word (to something other than its original form. Available in Mac OS X v10.7 and later. |
NSCorrectionResponseIgnored | 3 |
The user continued in such a way as to ignore the correction. Available in Mac OS X v10.7 and later. |
NSCorrectionResponseNone | 0 |
No response was received from the user. Available in Mac OS X v10.7 and later. |
NSCorrectionResponseRejected | 2 |
The user rejected the correction by dismissing the correction indicator. Available in Mac OS X v10.7 and later. |
NSCorrectionResponseReverted | 5 |
After the correction was accepted, the user reverted the correction back to the original word. Available in Mac OS X v10.7 and later. |
This class has no sub classes.
Some examples using this class:
- /MacCocoa/Spellcheck/NSSpellChecker Grammar
- /MacCocoa/Spellcheck/SpellCheck like TextEdit
- /MacCocoa/Spellcheck/SpellCheck RB
Blog Entries
- Spell Checking on Windows for Xojo
- MonkeyBread Software Releases the MBS Xojo Plugins in version 19.1
- MBS Xojo Plugins, version 19.1pr6
- MonkeyBread Software Releases the MBS Xojo Plugins in version 17.4
- MBS Xojo Plugins, version 17.4pr5
- MBS Real Studio Plugins, version 13.1pr1
- MBS Real Studio Plugins, version 11.3pr14
- MBS REALbasic plug-in 9.6
Xojo Developer Magazine
- 5.4, page 50: The Case of the Top 20, The mayor is caught in an explosive situation, and our boys are on the case by Toby Rush
- 17.3, page 11: News
- 15.6, page 9: News
Release notes
- Version 19.1
- Added more methods to NSSpellCheckerMBS class.
- Version 17.4
- Updated NSSpellCheckerMBS class for 64-bit.
The items on this page are in the following plugins: MBS MacCocoa Plugin.
NSSpeechSynthesizerMBS - NSSplitViewMBS