Text substitutions not working on MacOS Sierra 10.12.2

11

4

Just updated to 10.12.2 and text substitutions are not working anymore.

I use it a lot to create shortcuts to words. My list of replacements is still on System Preferences > Keyboard > Text, but they are not working anymore.

For instance, i have a 'tky' to 'Thank you very much' replace, and now when i type 'tky', it does not replace it anymore.

Any hints to make it work again ?

Thanks

delphirules

Posted 2016-12-15T21:24:44.220

Reputation: 379

3I've recently learned that this feature is only supported by some apps (e.g., Chrome does not support it currently). And for some that do like TextEdit, it may not be on by default (unless I disabled it at some point?). In the case of TextEdit, I had to enable it in that app's preferences ("Text Replacement" checkbox). The below command from @grgarside didn't enable this for some reason, but I didn't try an app restart, so maybe that's why. TIP: Spotlight works, so if you want to use a shortcut in an app without support, Cmd+Space to open Spotlight, type your shortcut, and copy/paste – Dolan Antenucci – 2017-03-02T16:37:06.397

Sometimes I have to select Edit / Substitutions / Text Replacement again in certain apps. For some reason it gets reset when I upgrade. – EricS – 2017-10-30T17:44:29.273

Answers

3

There are a few people reporting sporadic trouble with text shortcuts in 10.12.2. The general idea is to wait for iCloud to re-sync, possibly by adding a new substitution on a different device. You can also try resetting the shortcuts system by (making a backup then) trashing the following folder:

~/Library/Group Containers/com.apple.InputMethodKit.TextReplacementService

grg

Posted 2016-12-15T21:24:44.220

Reputation: 1 499

What does it mean when there are no files below this folder for all users? – Pup – 2018-06-13T11:09:34.557

2

On my iMac running macOS 10.12.4 I tried both of the above suggestions (manual restart, trashing the ~/Library/Group Containers/com.apple.InputMethodKit.TextReplacementService folder.)

Neither worked for me.

I then tried adding a new entry in the text replacement window (System Preferences > Keyboard > Text) and then text replacement started working.

Dave Creek

Posted 2016-12-15T21:24:44.220

Reputation: 29

1I also had to restart each affected app after adding the new replacement. Strange. – beporter – 2017-05-08T16:00:30.270

Yep this is what set it working for me! – SexyBeast – 2018-11-23T05:14:41.050

1

I've noticed when MacOS does an upgrade that need to restart, text substitutions won't work until you restart the machine manually. This happened with me in the last updates : after the update itself restart the machine, i have to restart it again manually to text substitutions work again. Hope it helps someone.

delphirules

Posted 2016-12-15T21:24:44.220

Reputation: 379

0

Try the following in the terminal:

defaults write -g WebAutomaticTextReplacementEnabled -bool true

axelferreira

Posted 2016-12-15T21:24:44.220

Reputation: 113

0

TL;DR: See the update at the bottom if nothing else.

For Mojave and Catalina... How to clear Text Replacements that refuse to be deleted, that do not sync to your iOS devices properly, or any other bug in the keyboard replacements you can't resolve by just using the System Preferences->Keyboard->Text user interface.

The text replacement database is stored here: ~/Library/KeyboardServices/TextReplacements.db

for the brave, you can open this with SQLPro for SQLLite or Valentina Studio (App Store links).

For the step-wise nuke from orbit, do this... (no data loss)

1 Backup your Text Replacements

  1. Open System Preferences
  2. Click Keyboard
  3. Click Text tab
  4. Click in list of replacements
  5. command + a to select them all
  6. Drag and drop to desktop (it creates Text Substitutions.plist
  7. Quit (close) System Preferences

2 Fully Delete the Text Replacements

  1. Open "Activity Monitor"
  2. find keyboardservicesd and "force quit" it
  3. find Keyboard Remote Service (System Preferences) and "force quit" it
  4. in Finder Command + G
  5. Paste in /Users/williamcerniuk/Library/KeyboardServices/
  6. Press "Go" button
  7. command + a to select all items in folder
  8. command + delete to put them in the trash
  9. (very important) delete ~/Library/Keyboard/textReplacements.cache

3 Restore Text Replacements Backup

Now here is the dicy part. The keyboard replacements you just saved off may actually have the problem in it, but try this anyway to get them back from the backup.

  1. Open System Preferences
  2. Click Keyboard
  3. Click Text tab
  4. Locate the file Text Substitutions.plist
  5. Drag file Text Substitutions.plist into the empty 'replace with' list

Now your old text replacements have re-appeared and with any luck the problem you were solving has been solved. The Text Replacements will start to sync to your iPhone, iPad and or iPod touch.

Be aware, this last step (21) may just end up copying the problem right back in. If so then...

Surgery of file Text Substitutions.plist may be necessary. Opening this file with any regular text editor enables you to hand modify it and remove entries until you can restore it and your problem is solved (presuming your problem exists at this point). Recommend using BB Edit from the App Store. Xcode has a nice editor but it is a behemoth-app and not worth downloading for this small task.

Update

A duplicate of the text replacements are stored in a hidden file in the system:

~/Library/Preferences/.GlobalPreferences.plist

with a plethora of other things. This file can be opened and manually edited if elements in the Text Replacements are not able to be removed per process above. Editing takes some technical savvy but can be done with BBEdit or Xcode. TextEdit tends to not be a good tool for editing plain text files.

William Cerniuk

Posted 2016-12-15T21:24:44.220

Reputation: 131

I just had 4 text replacement which would spring back in when I deleted all of them when just using the System Preference->Keyboard->Text GUI. I would select all, delete, then pop, pop,pop,pop they came back and broke synchronization. – William Cerniuk – 2020-01-17T23:09:46.063