This post originated from an RSS feed registered with Ruby Buzz
by Jared Richardson.
Original Post: Scripting OS X Applications with Ruby
Feed Title: Agile Artisans
Feed URL: http://agileartisans.com/main/rss
Feed Description: Jared's Blog
which has an example of the RubyOSA bridge that exposes the Apple events that an application makes available. That is to say, I can get access to tons of applications (including iTunes and TextMate) from a Ruby app.
RubyOSA is easy to use. Here's a quick example that shows the list of your TextMate documents.