Scripting Windows Apps — cover art: a wise old wildebeest (the GNU mascot) in a deep-oxblood waistcoat sits on a workbench stool holding a small wooden marionette cross, fine pale strings crossing the bench to a small brass-and-mahogany clockwork appliance with a single lit leaded-glass window.

2004 · Drunken Blog Rants · Rant

“We all (hopefully) know how useful scripting can be on our Linux boxes. But I'm not sure many Amazon folks have had the Win32-scripting side of things really 'sink in' yet. Once I start thinking this way, I'll spot all sorts of automation tasks that I'd never thought to automate before.”
— From Scripting Windows Apps, September 2004
Read the essay

© 2004 Steve Yegge. Originally published at Drunken Blog Rants.

Author’s note

A short and lighthearted essay about using Ruby to control Windows desktop applications. This was new territory back in 2004.

Now that AI has landed, app scriptability becomes a life-or-death differentiator. If an app can't be controlled and extended, it'll just get rewritten.

AI Notes

An internal Amazon post that wandered onto the public archive with "(confidential info deleted)" still stamped mid-script: Steve is writing for coworkers, ribbing them about the intranet login wall and telling them which in-house mailing list to join for Ruby talk. The central trick has outlived every tool it names. Rather than fight the auth system, he drives a browser that is already signed in and lifts the rendered page straight out of its DOM — the same move every modern browser-automation framework makes, arrived at here for the homely reason that his IE session was already logged in from that morning. The post also works as a skirmish in his 2004 campaign to convert Amazon's Perl holdouts to Ruby, complete with a sigh over Perl's mandatory trailing 1; and a postscript plugging a small "web testing with Ruby" project that grew up to become Watir.

Neither of the longer scripts survived the trip to Google Sites intact — line breaks got chewed and statements fused together, so they read fine as a technique and will not run as pasted. This is among the slightest entries in the Drunken run, a friendly workplace how-to whose Ruby-versus-Perl-versus-Python scorekeeping is strictly period material, and Steve's promised follow-up post on the topic never appeared. What's left to enjoy is the mood: a programmer who has just found a cheap trick he knows will pay rent for years, writing it down while the grin is still on.

Related listings

  • 2005

    Effective Emacs

    A few months later — the same automation reflex applied to the editor. The two pieces share a worldview: anything you do more than ten times should be a macro or a script.

  • 2004

    Tour de Babel

    Steve's mid-2004 language survey, written around the time he was reaching for Ruby for jobs like this one. The Win32OLE script is one practical answer to that essay's question of which language to use when.

  • 2006

    Software Needs Philosophers

    A year and a half on — the wider context. Scripting Windows Apps is a small piece of evidence for the larger argument that the engineering culture which treats automation as optional has already lost.