Bragging on AppleScript
Yesterday while "surfing here and there" (as my friend Panos likes to put it), I came across a post that had a snippet of AppleScript, which triggered fond memories. You see, a looong time ago I did a lot of AppleScript. Those were the days when I was using Claris Emailer and writing various Emailerscripts to extend it. We are talking about 1997 here. Now AppleScript doesn't have such an affection to text wrangling like perl (which I started using a bit later). It especially lacked afast way to search and replace in strings. So one winter evening I was sitting in my home office, turning this problem around in my head.
At some point I had an idea, a flash, a serious spell of "thinking outside the box". I came up with a fast way to search and replace, by abusing a built-in feature of the language. I made some simple tests and the thing was 600 times faster than the usual way of going through the text one character at a time. Now, I come from a culture where you shouldn't brag. When I grew up in Switzerland, little children learn that it's not really OK to insist that you're better than other children or that you did something soooo great. I was constantly hitting against that, but something must have stuck. Well, I still don't really like to brag, I prefer a tone of understatement, even when I think I did something great. On the other hand, I had included a quite braggy comment in the little subroutine that I wrote. The human ego is a confusing thing.
Back then, I should have published my find right away (there was even a discussion about search+replace on the AppleScript mailing list a week or two later). It would have been cool for me and it would have helped my fellow scripters. What I did was to write some more scripts for Emailer and publish those and together with announcing some of them, I wrote about my find. Much time later I also made a page about the thing called "austauschen", together with a snippet from that mail to the Claris Emailer mailing list (dated december 24th, 1997).
The way to do this has spread around, everybody in the AppleScript world is now using it and that's fine with me. Myself I'm not using AppleScript any more really. When I need something scripted I reach for a shell script much faster these days. So yesterday when I saw that post, I remembered all that story fondly: Yeah, I did that thing.