Atlas · Details
Scripting Windows Apps
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.