Check & Modify AutoCorrect Settings from the Command Line in OS X

Dec 18, 2014 - 5 Comments

Terminal in OS X Spelling autocorrect features tend to be divisive, with Mac users usually either loving it or hating it. Most Mac users know they can easily turn off autocorrect through an OS X system preference change, but the System Preferences are only accessible from the graphical interface of a Mac. If you’re wanting to automate the enabling or disabling of autocorrect for systems configuration or setup script, you may find it useful to know that you can not only check the active status of autocorrect, but also disable and enable autocorrect from the command line in OS X by using a defaults command string. This can be great in configuration and it can also be handy for making remote changes too.


This works in all versions of OS X that include the autocorrection of typos feature, including OS X Yosemite and OS X Mavericks. The command line approach to this is obviously intended for advanced users who would have good reason to use the terminal to modify a system setting that is otherwise toggled with the “correct spelling” setting instead.

Reading the Current Autocorrect Setting in OS X with Defaults Read

Want to find out from the command line if a specific Mac has autocorrect enabled or not? Use the following defaults read command:

defaults read -g NSAutomaticSpellingCorrectionEnabled

If you see a 1, autocorrect is on, and if you see a 0, it’s off. Binary.

(A quick side note, you can replace “-g” with “NSGlobalDomain” if you want to for clarity or some other reason, all of the default commands on this page will work the same with either)

Disabling Autocorrect with a Defaults Command Line String in OS X

Open the Terminal app and enter the following defaults string:

defaults write -g NSAutomaticSpellingCorrectionEnabled -bool false

The change should carry over to all apps instantly and not require a reboot, though some apps seem to be a bit more stubborn and relaunching them may be necessary. Two notable exceptions that need to be handled separately are Pages and TextEdit, which use an additional separate correction mechanism for typos and grammatical errors.

Turning off autocorrect from the command line in OS X and checking whether autocorrect is on or off

Do note this change will also appear within the System Preference panel setting, so if you turn it off in the command line then the spelling correction feature will appear off in the Keyboard settings too, and vice versa.

Re-Enabling Autocorrect with Terminal in OS X

If you decide you want to have autocorrect turned on again, simply changing ‘false’ to ‘true’ in the aforementioned command string will do the job. The full defaults syntax to re-enable autocorrect in OS X is as follows:

defaults write -g NSAutomaticSpellingCorrectionEnabled -bool true

Again the changes will take effect immediately and not require a reboot, and the setting adjustment will carry through into the GUI based system preference panel as well.

.

Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS, Tips & Tricks

5 Comments

» Comments RSS Feed

  1. Rafa says:

    Actually you have to add it and use both..

  2. Rafa says:

    for Yosemite the command changed.
    It is actually:
    defaults write NSGlobalDomain WebAutomaticSpellingCorrectionEnabled -bool false

    Cheers

  3. Alan Warner says:

    Would be nice to be able to fix the awful autocorrect functions on the iPhone, can’t stand it. Never says what I want it to, maybe better to just turn it off if it was even possible.

    • Raven says:

      Alan, iOS and OS X share the same list. Itā€™s a file you can edit on OS X in TextEdit. Iā€™ve done it in the past. I forget the details about where itā€™s located now, but you can Google for it.

      I went in and fixed some of the things it thinks it was fixing.

      You can also reset it in iOS and start over again.

  4. Ben says:

    In OS X before 10.9, you could add text substitutions for things like “ht e” or “i” to be auto fixed as typos. But since 10.9, Apple silently changed the rules and blocks spaces and any single character fixes.

    Any way to adjust these from terminal and restore that functionality?

Leave a Reply

 

Shop on Amazon.com and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks

News

iPhone / iPad

Mac

Troubleshooting

Shop on Amazon to help support this site