Platforms to show: All Mac Windows Linux Cross-Platform
Back to NSSpellCheckerMBS class.
NSSpellCheckerMBS.availableLanguages as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.7 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Requires Mac OS X 10.5.
NSSpellCheckerMBS.checkGrammarOfString(text as string, start as Integer, language as string, wrap as boolean) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
text: String to analyze.
start: Location within string at which to start the analysis.
language: Language use in string. When nil, the language selected in the Spelling panel is used.
wrap: true to specify that the analysis continue to the beginning of string when the end is reached. false to have the analysis stop at the end of string.
outDetails: Optional. On output, dictionaries describing grammar-analysis details within the flagged grammatical unit. See the NSSpellServer class for information about these dictionaries.
Returns Location of the first flagged grammatical unit.
Available in Mac OS X v10.5 and later.
See also:
Some examples using this method:
NSSpellCheckerMBS.checkGrammarOfString(text as string, start as Integer, language as string, wrap as boolean, Details() as dictionary) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
text: String to analyze.
start: Location within string at which to start the analysis.
language: Language use in string. When nil, the language selected in the Spelling panel is used.
wrap: true to specify that the analysis continue to the beginning of string when the end is reached. false to have the analysis stop at the end of string.
outDetails: Optional. On output, dictionaries describing grammar-analysis details within the flagged grammatical unit. See the NSSpellServer class for information about these dictionaries.
Returns Location of the first flagged grammatical unit.
Available in Mac OS X v10.5 and later.
See also:
NSSpellCheckerMBS.checkSpellingOfString(text as string, start as Integer) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns the range of the first misspelled word.
See also:
- checkSpellingOfString(text as string, start as Integer, language as string, wrap as boolean) as NSRangeMBS
- checkSpellingOfString(text as string, start as Integer, language as string, wrap as boolean, byref WordCount as Integer) as NSRangeMBS
Some examples using this method:
NSSpellCheckerMBS.checkSpellingOfString(text as string, start as Integer, language as string, wrap as boolean) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns the range of the first misspelled word.
See also:
NSSpellCheckerMBS.checkSpellingOfString(text as string, start as Integer, language as string, wrap as boolean, byref WordCount as Integer) as NSRangeMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns the range of the first misspelled word (and optionally the wordCount by reference).
See also:
NSSpellCheckerMBS.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()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
text: The string to check.
range: The range of the string to check.
checkingTypes: The type of checking to be performed. The possible constants are listed in NSTextCheckingType and can be combined using the C bit-wise OR operator to perform multiple checks at the same time.
options: The options dictionary specifying the types of checking to perform. See Spell Checking Option Dictionary Keys for the possible keys and expected values.
orthography: Returns by-reference, the orthography of the range of the string. See NSOrthographyMBS for more information.
wordCount: Returns by-reference, the word count for the range of the string.
Returns an array of NSTextCheckingResultMBS objects describing particular items found during checking and their individual ranges, sorted by range origin, then range end, then result type.
NSSpellCheckerMBS.completionsForPartialWordRange(start as Integer, length as Integer, text as string, language as string="") as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns an array of strings, in the order in which they should be presented, representing complete words that the user might be trying to type when starting by typing the partial word at the given range in the given string.
Within the text, length characters are picked starting at at position (0 based) and matched agains the dictionary defined by language.
Up to around 100 words are returned.
Requires Mac OS X 10.3.
Returns an empty string on any error.
Some examples using this method:
NSSpellCheckerMBS.correctionForWordRange(range as NSRangeMBS, text as string, language as string) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
range: The range of the word to be corrected.
text: The string containing the proposed correction.
language: The language.
Returns the proposed correct string.
NSSpellCheckerMBS.countWordsInString(word as string, language as string="") as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns the number of words in text. The language argument specifies the language used in the string. If language is the empty string, the current selection in the Spelling panel's pop-up menu is used.
Returns -1 if text is nil or this spellchecker function is not available.
Returns -1 if counting words isn't supported by the spell server selected.
Some examples using this method:
NSSpellCheckerMBS.deletesAutospaceBetweenString(precedingString as string, followingString as string, language as String = "") as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
In some cases the space automatically inserted after an accepted candidate should be deleted when the next text is typed (e.g. if it is a period or comma). This method allows clients to recognize these cases in a standardized way.
NSSpellCheckerMBS.dismissCorrectionIndicatorForView(view as NSViewMBS)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
NSSpellCheckerMBS.forgetWord(word as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSSpellCheckerMBS.guessesForWord(range as NSRangeMBS, word as string, language as string) as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
range: The range of the string to check.
word: The string to guess
language: The language of the string
Returns an array of strings containing possible replacement words.
Available in Mac OS X v10.6 and later.
See also:
Some examples using this method:
NSSpellCheckerMBS.guessesForWord(word as string) as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns nil on any error.
Returns an array of suggested spellings for the misspelled word word. If word contains all capital letters, or its first letter is capitalized, the suggested words are capitalized in the same way.
See also:
NSSpellCheckerMBS.hasLearnedWord(word as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.7 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns true if the word is known.
Requires Mac OS X 10.5.
NSSpellCheckerMBS.ignoredWords as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns nil on any error.
Some examples using this method:
NSSpellCheckerMBS.ignoreWord(word as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Requires Mac OS X 10.2.
Some examples using this method:
NSSpellCheckerMBS.languageForWordRange(range as NSRangeMBS, text as string, orthography as NSOrthographyMBS = nil) as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSSpellCheckerMBS.languageMenuEntries as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Copies the list of menu entries from the panel.
Currently you can use this names to show to the user and see what languages are available. It uses a private property which works for Mac OS X 10.4 and 10.5.
For the language function you need the short names:
Australian English | en_AU |
British English | en_GB |
Canadian English | en_CA |
Deutsch | de |
English | en |
Español | es |
Français | fr |
Italiano | it |
Multilingual | Multilingual |
Nederlands | nl |
Português | pt |
Protuguês do Brasil | pt_BR |
Svenska | sv |
NSSpellCheckerMBS.learnWord(word as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.7 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Requires Mac OS X 10.5.
NSSpellCheckerMBS.menuForResult(TextCheckingResult as NSTextCheckingResultMBS, checkedString as string, options as Dictionary = nil, atLocation as NSPointMBS, view as NSViewMBS) as NSMenuMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
TextCheckingResult: The NSTextCheckingResult instance for the checked string.
checkedString: The string that has been checked.
options: The options dictionary allows clients to pass in information associated with the document. See Spell Checking Option Dictionary Keys for possible key-value pairs.
location: The location, in the view’s coordinate system, to display the menu.
view: The view object over which to display the contextual menu.
Returns a menu suitable for displaying as a contextual menu, or adding to another contextual menu as a submenu.
NSSpellCheckerMBS.preventsAutocorrectionBeforeString(text as string, language as String = "") as Boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
This method allows clients to recognize these cases in a standardized way.
NSSpellCheckerMBS.recordResponse(response as Integer, correction as string, word as string, language as String = "")
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
response: The user’s response. The possible values are shown in NSCorrectionResponse.
correction: The corrected word. This should match the original correction.
word: The original word. This should match the original correction.
language: The language being edited. This should match the original correction.
When a correction is automatically proposed, the user may respond in one of several ways. Clients may report this to the spell checker so that it can learn from the user's response and adjust future correction behavior accordingly.
Use of this method implies that the client stored the original word and original correction at least from the point at which the user accepts it until the user edits or reverts it.
NSSpellCheckerMBS.requestCandidatesForSelectedRange(selectedRange as NSRangeMBS, stringToCheck as string, types as Int64 = -1, options as Dictionary = nil, tag as Variant = nil) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
NSSpellCheckerMBS.requestCheckingOfString(stringToCheck as string, range as NSRangeMBS, types as Int64 = -1, options as Dictionary = nil, tag as Variant = nil) as Integer
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 19.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
stringToCheck: The string to check.
range: The range of the string to check.
types: The type of checking to be performed. The possible constants are listed in NSTextCheckingType and can be combined using the C bit-wise OR operator to perform multiple checks at the same time.
options: The options dictionary specifying the types of checking to perform. See Spell Checking Option Dictionary Keys for the possible keys and expected values.
tag: An identifier unique within the application used to inform the spell checker which document that text is associated, potentially for many purposes, not necessarily just for ignored words. A value of 0 can be passed in for text not associated with a particular document.
The return value is a monotonically increasing sequence number that can be used to keep track of requests in flight.
Calls requestCheckingOfStringCompleted event later on main thread.
NSSpellCheckerMBS.setIgnoredWords(words() as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Some examples using this method:
NSSpellCheckerMBS.setLanguage(language as string) as boolean
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Normally chosen by a pop-up-list in the spelling panel and defaulted to the user's preferred language, so call this with care.
Set to "" to use the language from the panel popup menu.
NSSpellCheckerMBS.spellingPanel as NSPanelMBS
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop only |
Some examples using this method:
NSSpellCheckerMBS.unlearnWord(word as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Available in Mac OS X v10.5 and later.
Same as the older forgetWord.
NSSpellCheckerMBS.updatePanels
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
This method should be called when a client changes some relevant setting, such as what kind of spelling, grammar checking, or substitutions it uses.
Available in Mac OS X v10.6 and later.
NSSpellCheckerMBS.updateSpellingPanelWithGrammarString(lang as string, detail as dictionary)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
problemString: Problematic grammatical unit identified by checkGrammarOfString.
detail: One of the grammar-analysis details provided by checkGrammarOfString.
Available in Mac OS X v10.5 and later.
NSSpellCheckerMBS.updateSpellingPanelWithMisspelledWord(word as string)
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The checkSpellingOfString methods return the range of the misspelled word found. It is up to the client to select that word in their document and to cause the spelling panel to update itself to reflect the found misspelling. Clients can call updateSpellPanelWithMisspelledWord to insure that the spell panel is up to date.
Some examples using this method:
NSSpellCheckerMBS.userPreferredLanguages as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Returns an array containing the user's preferred languages for spell checking. The order is set in the system preferences.
If automaticallyIdentifiesLanguages is true, then text checking will automatically use this method as appropriate; otherwise, it will use the language set by Language property.
The older checkSpellingOfString and checkGrammarOfString methods will use the language set by Language property, if they are called with an empty language argument.
Available in Mac OS X v10.6 and later.
NSSpellCheckerMBS.userQuotesArrayForLanguage(lang as string) as string()
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
An array of quote replacements used by the NSTextCheckingQuotesKey key-value pair.
Available in Mac OS X v10.6 and later.
NSSpellCheckerMBS.userReplacementsDictionary as dictionary
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
method | Spell Checking | MBS MacCocoa Plugin | 9.6 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
The key-value pairs in this dictionary are used by the NSTextCheckingQuotesKey when replacing characters and words.
Available in Mac OS X v10.6 and later.
NSSpellCheckerMBS.WordFieldValue as string
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
property | Spell Checking | MBS MacCocoa Plugin | 11.3 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
(Read and Write computed property)
Some examples using this property:
The items on this page are in the following plugins: MBS MacCocoa Plugin.