Monday, January 28, 2008

Text Expansion: Wasting time trying to save time

Perhaps nothing is more irritating than trying to set up some time-saving software, having problems, and wasting lots of time resolving them. That's one reason why I found OS X so compelling when I first started using it; for the most part things just worked. Rather than fighting with the computer just to get the proper tools in place, I could actually get things done.

For reasons I'll go into some other time I have been searching for quite a while for ways to speed up my text input. My most recent endeavor was based on the idea of using text expansion to minimize the number of keystrokes I have to enter. As a special education teacher I had worked with the application Co:Writer by Don Johnston software, which does a fine job of text prediction as letters and sentences are typed. Unfortunately, a single license is $325. Since that is far too rich for my blood, I decided to set up a system of abbreviations myself. That can't be too hard, right? Guess again.

I found three programs that work as text expanders for OS X, Typinator, TypeIt4Me, and TextExpander. All are available as free trials with full licenses costing 19.95 Euros, $27, and $29.95, respectively.

All three programs work the same way. They run in the background watching your keystrokes. When you type a space, punctuation, or other defined key, the programs compare the keyboard buffer to the list of abbreviations you have defined. If there is a match, they backspace over what you have just typed, copy the expansion onto the clipboard, and paste its contents. A sound can also play when this happens.

To give you an example, I have "ty" defined as a shortcut for "thank you". When I start a new word with "ty" (typing it right after a space or other delimiter) and then type, say, a period, the text expansion program backspaces three times, deleting the delimiter and the "ty". Then it copies the expansion and the period onto the clipboard and pastes it into place, effectively replacing the "ty." with "thank you.". It may sound complicated, but it's really not.

The product pages for each program tend to emphasize the use of abbreviations for larger snippets of repetitive text like form letters. My usage goal was a little different. I wanted to use very short abbreviations for very common, but sometimes also very short, words. According to teacher school, if you take the 100 most common words in the English language, you can read (or write) 50% of all elementary text. One of the popular lists of words by frequency is Fry's First 100, named for its creator, Edward Fry. I figured that would be a good starting place for my abbreviations. Of course that is where the trouble started.

The Fry 100 Word List

I began simply enough. I had a text file of Fry's List with one word per line. The programs all had options for importing text files, so I started typing abbreviations after each word, with a comma in between. If a word was only one letter (like "I") or not easily abbreviated (like "in"), I deleted it from the list. For very common and short words I used one-letter abbreviations ("t" for "the", "n" for "and", etc.)

Unbeknownst to me, there were several problems with this. First of all, the programs would accept tab-delimited but not comma-delimited text. I had to search and replace all my commas with tabs, but not too big of a deal. Next, however, I discovered that the order I had put the abbreviation and expanded text were reversed. I didn't want to retype all of that (though it probably would have been faster in the long run), so I found a simple Java program that read in a comma delimited file and wrote it out differently and modified it to fit my needs. Unfortunately, after all of this I still had a problem with the encoding of the text. The text expansion programs would not accept Unicode, so I had to resave the file.

After all this conversion I finally had my abbreviations loaded into TextExpander. The program installs itself as a System Preferences pane and has a nice interface with some advanced features. You can decide on a "snippet" by snippet basis whether to type the delimiter and how to treat upper case. I started using the program while doing emails and blogging. As I encountered a new word that I use a lot, I would add a snippet if there was not one already. It was gratifying to hear the little beeps as I typed, knowing that I was saving keystrokes each time the sound played.

But my troubles were not over. For some reason my one-letter abbreviations were not working. It turns out that TextExpander and Typinator set a minimum of two letters for an abbreviation. While TextExpander correctly highlighted my snippets in red if I accidently created duplicates, it did not flag the one-letter snippets. This limitation eliminated much of the benefit of text expansion as I was using it. Fortunately TypeIt4Me allows single letter abbreviations, but changing programs led to another problem.

I had used TextExpander for a while and added some 50 new expansions. Once again I had new abbreviations that I had to transfer into a program. TypeIt4Me's "Open File..." would allow me to choose the TextExpander file, but no new words would appear. I took a look at the two programs' abbreviation files, both plain text XML. Both are standard Apple plists, even using the same name for most attributes. However, TypeIt4Me capitalized the first letter of each, while TextExpander did not, and XML is case-sensitive. In this case close did not count.

In my stubborn refusal to do data entry when something is already in a computer, I ended up with another time consuming solution. I took the TextExpander XML file and used XSLT to parse out each abbreviation and expansion and write them to a tab-delimited text file for import into TypeIt4Me. I'll try to be an optimist and imagine that maybe somewhere all this foolishness of mine will be useful to someone else.

I have since gotten TypeIt4Me set up to my liking. I have a shortcut key to toggle it on and off, and another to add a new abbreviation. My abbreviation file has grown to over 200 items. I have also learned not to type too fast after a replacement is triggered, or sometimes I end up typing in the middle of the copy and paste.

TypeIt4Me has a nice feature where it tracks the number of expansions done and keystrokes saved. As you can see below, it will be a while before I make up the hours spent mucking around with these programs, but I did get to polish up my Java and XML knowledge and eventually solve my problems.
TypeIt4Me shows how many keystrokes have been saved.

1 comment:

Michael B. said...

Nice. I particularly like this line "In my stubborn refusal to do data entry when something is already in a computer" as an indication of something we've all done. I often find myself looking for the "simple" solution to a problem and end up doing far more work than if I'd just started over. It reminds me of the question, "Do you want to win, or do you want to be happy?" It seems we stubborn people repeatedly choose the former over the latter.