1

Wikipedia has some nice lists of misspellings for machines:

How to import them as text replacement definitions in System Preferences > Language & Text > Text?

2 Answers 2

1

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.

  1. Create a folder for storing related files, for example using Terminal.app:

    $ mkdir ~/Documents/OS\ X

  2. 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

  3. Create a new document in TextWrangler.

  4. 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.

  5. Copy the text from Wikipedia and paste it into the newly created TextWrangler document.

  6. [Replace All] occurences of '->' with ',' using the menu command Search -> Find.

  7. Insert the Prefix '1,' on all lines using the menu command Text -> Prefix/Suffix Lines....

  8. Prepend the file with this line (as first line): on,replace,with

  9. Save the file to the ~/Documents/OS\ X folder and make sure that the file name ends with '.csv'.

  10. Drag the '.csv' file to Plist Converter.app and click the button [Convert Plist].

  11. Open the newly created '.plist' in TextWrangler.

  12. Replace all occurrences of '<string>1</string>' with '<integer>1</integer>'.

  13. Save the replace .plist file and quit TextWrangler.

  14. 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.

2
  • 1
    The English list contains multiple replacements for one source. You need to pick one of the options before step 6 (Find and replace '->' with ',').
    – Pro Backup
    Commented Jul 28, 2013 at 21:50
  • 1
    Can you post the final plist file please?
    – JBaruch
    Commented Sep 29, 2014 at 0:36
0
  • Close the Language & Text preference pane if it is open
  • Copy the list from Wikipedia and run pbpaste | sed 's|,.*||;s|^|<dict><key>on</key><integer>1</integer><key>replace</key><string>|;s|->|</string><key>with</key><string>|;s|$|</string></dict>|' | pbcopy
  • Run f=~/Library/Preferences/.GlobalPreferences.plist; plutil -convert xml1 $f; open -e $f and add the entries to the NSUserReplacementItems array
  • Quit and reopen applications to apply the changes
1
  • It would be nice to briefly explain what these commands do. Commented Mar 18, 2015 at 12:42

You must log in to answer this question.

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