Ruby OSA – Applescript Bridge in Ruby
This is a Github port from the 2007 version of ruby-osa from rubyforge. There is a Bus Error due to an old libxml-ruby dependency. This fixes it and allows you to develop it easier. Note: this is a local gem installation.
Before you install this, install an older version of libxml-ruby:
sudo gem install libxml-ruby -v=0.3.8.4
sed -i -e "s|require ‘xml/libxml’|gem ‘xml/libxml’, ‘= 0.9.5′|" /path/to/gems/rubyosa-0.4.0/lib/rbosa.rb
Then install it (from this source, since
sudo gem install ruby-osa installs from rubyforge and is outdated):
git clone email@example.com:viatropos/ruby-osa.git cd ruby-osa rake install
And install the rdoc of your favorite app to see all the methods!
rdoc-osa --name iTunes --op iTunes_rDoc
RubyOSA is a bridge that connects Ruby to the Apple Event Manager
It automatically populates the API (classes, methods, constants) according
to the target application’s scriptable definition.
RubyOSA is an alternative to RubyAEOSA, and meant to replace it.
RubyOSA is licensied under a BSD license, see the COPYRIGHT file for more
More information on the project home page: http://rubyosa.rubyforge.org.
Mac OS X 10.4.X or greater
ruby 1.8.X or greater
libxml-ruby 0.3.8 or greater
$ ruby extconf.rb
$ sudo make install
$ sudo make install-extras
`make install’ will only install the core of the bridge, while
`make install-extras’ will install some additional tools such as the rdoc-osa
A tutorial is available online at http://rubyosa.rubyforge.org/tutorial.html.
Sample code is available in the `sample’ sub-directory.
The rdoc-osa tool can be used to generate API reference documentation
for the given application. See its —help flag for more information
about how to use it.
Feel free to send feedback to firstname.lastname@example.org.
You can also file bugs, patches and feature requests to the tracker:
When reporting a bug, please set the AEDebugSends and AEDebugReceives
environment variables to 1 and attach the logs.