RubyAEOSA

[RubyCocoa] [RubyAEOSA]

[English] [Japanese]

What's New

[2006-10-11] RubyAEOSA is deprecated, and development of it have closed. RubyOSA is available as the best alternative. Check it out! <URL:http://rubyosa.rubyforge.org/>

[2003-06-19] The latest version is 0.2.3

What is RubyAEOSA ?

RubyAEOSA is Ruby extension libraries for using AppleEvent and OSA Scripting Component (OSA = Open Scripting Architecture) on MacOS X. Using RubyAEOSA with a Ruby script or RubyCocoa applicaiton, you can:

with Mac OS X 10.2 (Jaguar)

You can use RubyAEOSA with pre-installed Ruby in Mac OS X 10.2 (Jaguar). You don't need to install extra Ruby in Jaguar.

Script Examples

open specified URL on Internet Explorer using AppleScript.

require 'osx/aeosa'

URL = "http://www.ruby-lang.org/"

SCRIPT = <<SCRIPT
tell application "Internet Explorer"
  activate
  openURL "#{URL}"
end tell
SCRIPT

OSX.do_osascript (SCRIPT)

send required AppleEvent command to Internet Explorer.

require 'osx/aeosa'
app = OSX::AEDesc.application "Internet Explorer"
app.open_docs "html/INDEX.en.html"
app.activate
app.quit_app

send AppleEvent to TextEdit.

require 'osx/aeosa'
app = OSX::AEDesc.application "TextEdit"
app.ae_send ('aevt', 'odoc', OSX::AEDesc.fss ("README.en"))
app.ae_send ('aevt', 'quit')
app.aevtodoc OSX::AEDesc.fss ("README.en")
app.aevtquit

print a result of AppleScript to stdout.

require 'osx/aeosa'

app = OSX::AEDesc.application "TextEdit"
app.open_docs("README.en.txt")

SCRIPT = <<SCRIPT
tell application "TextEdit"
  tell text of front document
    third paragraph
  end
end
SCRIPT

puts OSX.do_osascript(SCRIPT).to_s.strip

Screenshot

This is a screenshot of running a Cocoa application that consists of only Ruby scripting and Interface Builder's Nib file by RubyAEOSA and RubyCocoa.

Getting RubyAEOSA

binary for Mac OS X 10.2

Donwload a file named "RubyCocoa-0.3.x.dmg" from the file list. There are RubyCocoa and RubyAEOSA libraries, libruby.a, sample codes and etc. The libraries which is necessary for execution and development is a ".pkg" format package. So you can easily install it.

source

Donwload a file named "rubyaeosa-0.2.x.tgz" from the file list.

PINEAPPLE RPM Package

RPM format binary exist on Project PINEAPPLE (Japanese).

Documents

Links

Comments and Bug Reports

Feel free to send comments, bug reports and patches.

FUJIMOTO Hisakuni, <hisa at fobj.com>, $Date: 2004/06/28 01:43:52 $ $Revision: 1.23 $