How can I import text substitutions from Wikipedia "Lists of common misspellings for machines"? Wikipedia has some nice lists of misspellings for machines:


http://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
http://nl.wikipedia.org/wiki/Help:Veelvoorkomende_spelfouten/machines
http://es.wikipedia.org/wiki/Wikipedia:Lista_de_errores_ortogr%C3%A1ficos_comunes/M%C3%A1quinas


How to import them as text replacement definitions in System Preferences &gt; Language &amp; Text &gt; Text?
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 &gt; ~/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 '-&gt;' with ',' using the menu command Search -&gt; Find.
Insert the Prefix '1,' on all lines using the menu command Text -&gt; 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 '&lt;string&gt;1&lt;/string&gt;' with '&lt;integer&gt;1&lt;/integer&gt;'.
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.