What’s this all about then?
rb-appscript is a powerful way to automate your Mac. It's similar to Applescript but it's built in Ruby, which means you get to leverage that language's powerful syntax and libraries. Giving you more time to make toasted sandwiches. You want long-winded explanations? We got those.
Please note that these scripts are by no means bulletproof, and are intended to provide examples of application scripting. I take no resposibility for any loss of data or mishaps; you download and run everything at your own risk. That said, I use all of these scripts in a production environment every day (well – more accurately, I use some of these scripts in a production environment most days).
About
If you’re reading this, it’s overwhelmingly likely that you’re … kinda a nerd. Which is great! I don’t need to explain why scripting applications might be a great idea. You’re an aficionado; a convert. You drank the Koolaid.
You might already know, in fact, that rb-appscript is a tremendously powerful way to control your applications. You get the ubiquity of Apple Events combined with the power of Ruby. You get the best of both worlds, all while helping to prevent tooth decay.
The biggest hurdle that the first time rb-appscripter faces, in my humblest of opinions, is identical to the problem that the first time Applescripter faces. It’s difficult to figure out how to address the object you’re talking to. Every application has a unique scripting dictionary; you can guess at the objects and their properties some of the time – but if you’ve spent any time scripting with Apple Events you’ve probably ended up banging your head against some metaphorical wall while asking some widget to cough up some property. I know I have.
As rb-appscript doesn’t enjoy the popularity of Applescript, it helps to have as many examples of actual, functioning scripts as possible. Some of scripts on this site are trivial one-liners. They’re not pretty, and they are by no means bug-free (not even close), but they all work.
So: The Joy of Appscript. My little project to share with the world the fruit of my rb-appscript labours. I don’t really anticipate many people downloading these scripts and using them in a production environment; ruby and command line action is too daunting for the typical user. I do hope, however, that my inconsequential noodlings can help a potential rb-appscripter. Maybe even you.
Ian
ianhaigh.com