Move over AppleScript, here comes Ruby!

RubyOSA provides a bridge from Ruby to the Apple Event Manager. It allows Ruby programs to automate Mac OS X applications in the same way as AppleScript. This is especially neat because it opens the door for developers to write web applications with Ruby on Rails that could include some integration with the Mac (perhaps pulling song lists from an iTunes library and importing them into a web application’s database). I’m sure there’s plenty of opportunities for integration.
Applescript to minimize all application and finder windows
I created an applescript, Minimize, that will minimize all application and finder windows. The best way to use it is to assign a Quicksilver trigger to it. Do so by calling it via osascript and run it in a shell.
- Open Quicksilver, then type (command-’) to open the custom triggers section
- Add a new command by clicking the plus sign at the bottom of the window
- Type . (dot) to put it into edit mode
- Type ‘osascript /path/to/minimize.scpt’
- Hit tab and choose “run command in shell.”
- Assign a trigger to it (I use shift-command-w)

Download Minimize (right click, save link as)
Note: If you don’t want to do this using an applescript, you can do the same thing with a couple of extra steps: command-tab to the finder, then hit option-command-h followed by option-command-m.