I don't have this issue, pressing the enter key also works instead of space.
I created a custom Text Substitution in Language & Text, then opened TextEdit and it worked on any key press, not just space or enter.
Thanks to Sacrilicious identifying the actual file/key where the data is stored, I figured out how to copy the whole thing with a few Terminal commands.
Make sure you don't have System Preferences open while doing this, or it may not work!
- On your old install, run
/usr/libexec/PlistBuddy -x -c "Print NSUserReplacementItems" ~/Library/Preferences/.GlobalPreferences.plist > backup.plist
- This saves the substitutions to the
backup.plist
file in whatever directory you ran that command from (by default, your home directory).
- Copy that
backup.plist
file to your new install (I recommend your home directory for simplicity).
- On the new install, run
/usr/libexec/PlistBuddy -c "Delete NSUserReplacementItems" ~/Library/Preferences/.GlobalPreferences.plist
, then run /usr/libexec/PlistBuddy -c "Add NSUserReplacementItems array" ~/Library/Preferences/.GlobalPreferences.plist
- This wipes the default substitution list and creates a new blank one.
- Again on the new install, run
/usr/libexec/PlistBuddy -c "Merge /PATH-TO-BACKUP/backup.plist NSUserReplacementItems" ~/Library/Preferences/.GlobalPreferences.plist
, first replacing the /PATH-TO-BACKUP/backup.plist
part with the actual path to wherever you saved the backup file.
That should do it. Open System Preferences to double check, but you should have an identical copy of your text substitutions on your new install.
Best Answer
After having read How can I export text substitutions from Lion for import into Mountain Lion made clear to me that PlistBuddy was a good way to go.
Create a folder for storing related files, for example using
Terminal.app
:$ mkdir ~/Documents/OS\ X
Create a backup of the existing text replacements:
$ /usr/libexec/PlistBuddy -x -c "Print NSUserReplacementItems" ~/Library/Preferences/.GlobalPreferences.plist > ~/Documents/OS\ X/UserReplacementItems-backup.plist
Create a new document in TextWrangler.
Change the encoding of the document (bottom of the window) to Western (Windows Latin 1). Otherwise
Plist Converter.app
replaces any accented characters with an incorrect value.Copy the text from Wikipedia and paste it into the newly created TextWrangler document.
[
Replace All
] occurences of '->
' with ',
' using the menu commandSearch -> Find
.Insert the Prefix '
1,
' on all lines using the menu commandText -> Prefix/Suffix Lines...
.Prepend the file with this line (as first line):
on,replace,with
Save the file to the
~/Documents/OS\ X
folder and make sure that the file name ends with '.csv
'.Drag the '
.csv
' file to Plist Converter.app and click the button [Convert Plist
].Open the newly created '
.plist
' in TextWrangler.Replace all occurrences of '
<string>1</string>
' with '<integer>1</integer>
'.Save the replace .plist file and quit TextWrangler.
Now make sure you don't have System Preferences open while doing the import, or it may not work!
/usr/libexec/PlistBuddy -c "Merge '$(ls ~/Documents/OS\ X/common-typos.plist)' NSUserReplacementItems" ~/Library/Preferences/.GlobalPreferences.plist
Don't forget to replace
common-typos.plist
with the file name you created.