betabug... Sascha Welter

home english | home deutsch | Site Map | Sascha | Kontakt | Pro | Weblog | Wiki

23 November 2011

Bragging on AppleScript

Looking at some stuff I did waaaay back

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.

Posted by betabug at 10:36 | Comments (0) | Trackbacks (0)
ch athens
Life in Athens (Greece) for a foreigner from the other side of the mountains. And with an interest in digital life and the feeling of change in a big city. Multilingual English - German - Greek.
Main blog page
Recent Entries
Best of
Some of the most sought after posts, judging from access logs and search engine queries.

Apple & Macintosh:
Security & Privacy:
Misc technical:
Athens for tourists and visitors:
Life in general:
<< Notes on Zope 2 migration | Main | Installing psycopg2 on Mac OS X 10.6 with a 64bit Python >>
There are no comments.
You can trackback to:
There are no trackbacks.