11

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

2
  • 3
    I'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 Mar 2 '17 at 16:37
  • Sometimes I have to select Edit / Substitutions / Text Replacement again in certain apps. For some reason it gets reset when I upgrade. – EricS Oct 30 '17 at 17:44
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
1
  • What does it mean when there are no files below this folder for all users? – Pup Jun 13 '18 at 11:09
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.

2
  • 1
    I also had to restart each affected app after adding the new replacement. Strange. – beporter May 8 '17 at 16:00
  • Yep this is what set it working for me! – SexyBeast Nov 23 '18 at 5:14
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.

0

Try the following in the terminal:

defaults write -g WebAutomaticTextReplacementEnabled -bool true
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.

1
  • 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. – Cerniuk Jan 17 '20 at 23:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.