1

OS X Lion has an iPhone-like autocorrect feature as you're typing.

This feature interferes with my typing app. The people using my app would not want it turned on at all, system wide. I need to turn off all auto-correct off for all apps, not just in my own NSTextField.

Is there any way for me to check/set the global/system auto-correct feature to OFF? Or am I stuck basically providing a guided tutorial for how to turn it off?

Solution must be legal for the Mac App Store.

ck_
  • 3,719
  • 10
  • 49
  • 76

2 Answers2

1

Is this in an NSTextView? If so, there are several methods available to alter the correction behavior:

- (void)setAutomaticSpellingCorrectionEnabled:(BOOL)flag
- (void)setAutomaticTextReplacementEnabled:(BOOL)flag

Please try those, they should be what you are looking for.

sosborn
  • 14,676
  • 2
  • 42
  • 46
  • Sorry, should have specified. Need to turn auto-correct off system-wide. These methods are great for anyone just turning it off in their app however. – ck_ Nov 16 '11 at 18:33
  • There is no way to do that and still be legal for the app store that I know of and to be honest, I would not install an app that pretended to know what I wanted for a particular system preference. – sosborn Nov 16 '11 at 22:36
  • What if you were installing a "better auto-correct" app? Installing something like that obviously means you wouldn't want to use the default one at the same time. My app comes down to something like that. – ck_ Nov 17 '11 at 00:00
  • No, but that's because I hate auto-correct anyway :) I think app store distribution is going to be tough for you regardless because of the upcoming sandbox policy. You might want to consider distribution outside of the app store just in case. – sosborn Nov 17 '11 at 00:05
  • Does sandboxing really mean "no system-wide apps"? From what I've seen it blocks access to the file system, etc, but not to CGEventTaps. That'll be a big problem if true. – ck_ Nov 17 '11 at 01:59
0

Finally, there is additional API to support the new global user preference settings for automatic text replacement and spelling correction. NSTextView now by default will keep track of and follow these settings automatically, but applications using NSTextView can override that by programmatically using existing NSTextView methods such as -setAutomaticTextReplacementEnabled: and -setAutomaticSpellingCorrectionEnabled: to control an individual text view's settings. The new API is primarily for non-text view clients who wish to keep track of the settings for themselves, using the NSSpellChecker class methods to determine their values, and optionally also notifications to determine when the settings have changed.

+ (BOOL)isAutomaticTextReplacementEnabled;
+ (BOOL)isAutomaticSpellingCorrectionEnabled;

NSString * const NSSpellCheckerDidChangeAutomaticSpellingCorrectionNotification;
NSString * const NSSpellCheckerDidChangeAutomaticTextReplacementNotification;

https://developer.apple.com/library/mac/#releasenotes/Cocoa/AppKit.html

ck_
  • 3,719
  • 10
  • 49
  • 76