Utility software

Typing time saver

In working on my daily postings to the Mac OS X Hints and Macworld Web sites, I do a lot of repetitive typing. Here are just a few examples of such repetition:

  • If I put a file up on the Mac OS X Hints download page, I need to link to it via a relatively lengthy URL (spaces added to allow line wrapping here):

    <a href="http://www.macosxhints.com/ dlfiles/____"></a>

  • I often use a styled box (thin border, yellow background) to call out a section of a page, which I do via a wordy inline style command (line breaks added for a narrower display):

    	<div style="border:1px solid #000099; background-color: #FFFDBB; padding: 5px;
    	margin-left: 5%; margin-right: 5%;">
    	

  • I frequently need to insert the HTML code for the Command key( &#8984; ) to generate, well, the Command-key graphic (⌘).
  • Due to the way I post to the Mac OS X Hints site, I need to run a MySQL command on the hints on my local Mac before I upload them to the server. This command has to change each day, as it includes the current date:

    	Update stories set related=replace(related,’192.168.1.20/’,
    	’www.macosxhints.com’) where date>’2005-10-03 01:04:51’
    	

    That command changes a URL reference in the database from my local machine to the hints server, so that certain links will work correctly.

  • Then there’s my all-time, most-used text blurb: (Control-click on the program’s name, then choose “Show Package Contents” from the pop-up menu.) . That one goes after nearly any reference to navigating into an OS X bundle, as you’re probably aware.

A Finger Saver

On any given day, I’ll end up using some or all of these strings on multiple occasions. After a while, the fingers grow tired of pounding the same keys over and over again, so the brain goes in search of a better solution. Enter Peter Maurer’s Textpander 1.1 (   ). Textpander is an abbreviation utility, much like TypeIt4Me (   , July 2003 ). However, I prefer Textpander for its simpler installation (it’s a System Preferences pane, not an input method that requires a full system restart) and more gentle pricing model (Textpander is unpriced donationware; TypeIt4Me is $27 shareware). After playing with both for a bit, I also found I preferred Textpander’s method of creating new shortcuts—it just seemed more intuitive to me.

Textpander Interface

The main Textpander interface is a preferences panel, with a simple three-tabbed interface:


The Snippets tab is used for your clippings—and though I use Textpander strictly for pasting pure text, it can also handle images, or a mix of text and images, in its Snippets. Creating an abbreviation couldn’t be simpler; just click the plus sign, type or paste your content, and then type the abbreviation you’d like to use. I’ve chosen to preface most of my shortcuts with two exclamation points, but you can use whatever you like. As soon as you’ve assigned a new abbreviation, it’s instantly available, even to running applications. Textpander seems to do a great job of capturing keystrokes; it works in Cocoa, Carbon, and even Java applications. It won’t, however, work in Classic apps. (The keystrokes are recognized by Textpander in Classic apps, but the abbreviations are not pasted in.)

The Preferences tab lets you set the default mode for matches (i.e., case sensitive or not), snippet format, and, most importantly, when to replace abbreviations. The mode I prefer is “when typed,” which basically means as soon as Textpander recognizes an abbreviation, the full snippet is inserted. You can also use it in a “delimiter” mode, whereby the text won’t be replaced until you type a space, tab, or return. You can also use the Preferences tab to create a list of apps that Textpander will basically ignore. (In other words, in which it will not try to expand your abbreviations.)

The Updates tab is simply used to check for new versions of the program, either automatically or manually.

About Snippets

One of the things I love about Textpander is the intelligence that you can encode in a snippet. Consider the MySQL example above, which needs to have the current date inserted each time I run it. As a snippet, the text looks like this:

	Update stories set related=replace(related,’192.168.1.55/’,
	’www.macosxhints.com’) where date>’%Y-%m-%d 01:04:51’
	

The %Y, %m, and %d variables are replaced, respectively, with the four-digit year and two-digit month and day numbers whenever I type the abbreviation for this snippet ( !!rel ). Consider also the download file URL above—after typing it, it’d be ideal if the cursor were positioned right in the middle of the URL, between the < and the /a>. Textpander makes this easy with a “position cursor here” variable:

<a href="http://www.macosxhints.com/dlfiles/____">%|</a>

I type the abbreviation, type the name for the link, then backspace a few times and replace the underscore with the name of the uploaded file. It’s not completely automated, but it sure beats typing the thing out by hand each time! There are other ways to position the cursor, as well as settings for the time and keeping or dropping the delimiters, if you have Textpander set to act after typing a delimiter.

Raves and Rants

I love Textpander’s simplicity of installation and removal—and a simple checkbox to deactivate it without uninstalling—as well as the ease with which I can create shortcuts. Textpander’s ability to capture the shortcuts in every application I throw at it also impresses me.

On the downside, one thing you can’t do with Textpander is insert Command-key shortcuts into the abbreviations. For instance, I could fully automate the download URL shortcut, noted above, if I could just tell Textpander to hit ⌘-V instead of typing those underscores. Alas, Command-key commands can’t be encoded into snippets. (Interestingly, you can do this the basic macro facilities in Butler, another Peter Maurer product—so I’ve used Butler to work around this limitation for a couple of shortcuts.) It’s also not a replacement for a full-blown macro program, such as QuicKeys X3, but then again, it’s not supposed to be.

Conclusion

If you type the same strings over and over, and you’re looking for a way to save your fingers some wear and tear, Textpander is worth a look-see. Just remember it’s donationware, so you should contribute what you feel its worth if you decide to keep using it.

Subscribe to the Help Desk Newsletter

Comments