Appendix A. Scripting with MacRuby

Sometimes a window-based Cocoa application is too much for what you need to accomplish. Ruby developers are accustomed to using the language to write quick scripts that perform occasional lightweight tasks that don’t need a graphical interface. MacRuby is no different and lets you accomplish the same thing while being able to interact with Mac OS X applications that conform to Apple’s Open Scripting Architecture (OSA) through the Scripting Bridge framework.

AppleScript is Apple’s language for interacting with applications that are OSA compliant. For a long time, AppleScript has been the language of choice for scripting on the Mac. With Apple’s continued Ruby and MacRuby support, we wouldn’t be surprised to ...

Get MacRuby in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.