10

I've been looking for an answer to this question for a while, so I'm guessing this can only be solved with a console command.

What I want to do is disable 'Text Replacement' everywhere on my Mac. The trick is, I have a library of text replacements that I use on my iPhone (like ill > I'll), and apparently it's synced to my iCloud account. As a result, if I make changes in one place it affects all of my devices everywhere - making the easy solution of "delete all of the text substitutions from your substitution library" is unavailable.

The text replacement I'm referring to specifically is the option you can disable by right-clicking on any text input area, then selecting 'Substitutions < Text Replacement' (see image).

Disabled 'Text Replacement'

I know you can disable this one field at a time by right-clicking fields and unchecking 'Text Replacement', but it is enabled by default for every individual input on every field for every application (including the entire internet and my browser's search/address bar), and it periodically gets re-enabled on some inputs.

I've already disabled 'Correct Spelling Automatically' from my system text options. (see image)

Disabled 'Correct Spelling Automatically'

And still I have to disable 'Text Replacement' on every field or it will try to correct my typing with entries in that dictionary.

I use iCloud tabs, handoff, and a number of Apple's other "Better Together" features (and I don't want to lose the ability to track my devices with 'Find my [device]'), so I don't want to disassociate my iCloud account from my computer or devices, but I'd be really happy if I never had to disable 'Text Replacement' on an input field again.

Any suggestions or ideas would be greatly appreciated!

EDIT: I've found https://apple.stackexchange.com/a/217387/172938 and https://apple.stackexchange.com/a/121553/172938 , both of which have some console references:

defaults write -g WebAutomaticTextReplacementEnabled -bool true from the first link (for enabling 'Text Replacement' in Safari).

defaults delete -g NSUserDictionaryReplacementItems from the second link (for deleting the User Dictionary as seen in my second image).

Both pertain to my issue tangentially, but each to the opposite effect I'm looking for.

  • If you disable iCloud Drive, they'll stop syncing between devices. Not sure if there's a more granular setting within iCloud Drive (e.g. just unchecking System Preferences) that will prevent the syncing. – BallpointBen Jul 28 '17 at 21:13
  • Brian D - did you ever manage to figure this out? If so, you should post the answer so we can upvote it. Will give you some reputation points as well :) – J. Venator Feb 13 '18 at 3:38
  • @j-venator I did not figure out any solution. I believe updating to Mac OS 10.13 eliminated the problem. – Bmd Feb 19 '18 at 17:54
  • The problem still exists in macOS 10.13.6 High Sierra. – 2540625 Aug 9 '18 at 5:37
  • This is especially vexing for Spotlight, with no way easily to disable there. – 2540625 Aug 9 '18 at 6:29
5

Very late, but

defaults write -g WebAutomaticTextReplacementEnabled -bool false

Will disable text replacement not just in Safari but in all other apps that use that input method (e.g. Evernote).

Reboot is required (at least as of macOS 10.13.6), and the menubar checkmark UI won't visually change within each app. The change also only affects applications, and not Spotlight.

| improve this answer | |
  • For those who don't know, open Terminal app and paste that line and press enter. – Joseph Hansen Jul 11 '18 at 18:32
  • 1
    This doesn't seem to have any effect for me on Mac OS 10.13.6. Not even with sudo. – Bmd Jul 13 '18 at 19:40
1

Somehow I messed up the Keyboard - Text replacement database (drag & dropped a imewlconverter converted plist into the GUI).

With 100k+ entries any input becomes very sluggish (I can feel the latency), it's also been synced to iOS (same iCloud ID) which I don't want as I have iRime.

Tried to manually remove all the entries (by selecting all) and click on the - but it didn't work, all entries re-appear like ghosts after a few seconds or simply didn't work.

Disabling iCloud Drive sync (System Prefs) and retried, didn't work either. It does NOT matter (on or off syncing System Prefs).

Turned out to be: I've opened Keyboards - Text Replacement on iOS which still had the huge list of entries at the time, the action triggered an instant sync back from iOS to macOS (really!).

defaults delete -g NSUserDictionaryReplacementItems did not work for me on macOS 10.14.

Later on I figured out (thanks to find and fd), it is possible to remove all TextReplacements.db* files under ~/Library/KeyboardServices, open Keyboard - Text again to regenerate the text replacement DB files, issue resolved.

The files needs to be removed and generated

TextReplacements.db
TextReplacements.db-wal
TextReplacements.db-shm

Worked on both macOS 10.14 and 10.15.

NOTE: Last but not least, do a Reset Keyboard Dictionary on iOS devices with the huge list of entries to avoid syncing back to macOS.

IMPORTANT: be aware of iCloud sync across multiple iOS / macOS devices, the sync can be instant so the text replacement items may mysteriously come back, check every device and make sure they don't push (sync) to other devices.

Mission accomplished.

| improve this answer | |
0

As far as I know, there is still no good solution to this problem (as of late 2018 and 10.14.1). It was one of the first things I checked when I installed Mojave, and I was disappointed yet again.

I believe the problem is that the text replacement setting is very granular, per-window/tab. There is no per-app or global switch that will be respected. (The defaults write command described above may help in some apps/contexts, but definitely not most.) Text replacement relentlessly defaults to ON in any new window/tab, with a few odd exceptions. In apps where all the action happens in one window (e.g. Messages), you can turn it off and largely forget it, but in apps where you're constantly generating new windows/tabs, text replacement is effectively unkillable — if you have them, you will trigger them.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .