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

Steve, in late 2004, had a stack of Word documents to convert to a particular XML format and reached for Ruby instead of XSLT. The job was small enough that Ruby's built-in win32ole support became the centrepiece, and the post opens with the small surprise of how clean Win32 scripting can be from Ruby. The sharper example follows: scraping Amazon's internal mailing-list pages by instantiating an invisible Internet Explorer, navigating past Isaac auth, and pulling rendered HTML out the back. Two short working scripts — email-diff and whosin — give the reader the five-line incantation for "drive IE programmatically and parse the result." The tone is exactly that of a developer who has discovered something he expects to use a hundred more times: pleased, slightly conspiratorial, already imagining the follow-ons (automating a fresh Windows install, scripting Outlook to pre-accept meetings).

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.