# Pure Ruby App that receives events

**URL:** <https://www.ruby-forum.com/t/pure-ruby-app-that-receives-events/145480>\
**Category:** Ruby\
**Created:** [August 10, 2008, 3:55pm UTC](https://www.ruby-forum.com/t/pure-ruby-app-that-receives-events/145480 "2008-08-10T15:55:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [August 10, 2008, 3:55pm UTC](https://www.ruby-forum.com/t/pure-ruby-app-that-receives-events/145480/1 "2008-08-10T15:55:54Z")

</div>

Does anyone know if it is possible to have a Ruby application that  
receives Apple Events? I assume it would be in an event loop. Really,  
what I’m asking is if I can create a pure Ruby app that behaves like a  
“first class” application as Apple has promised.

Thank you,  
pedz

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [August 10, 2008, 5:46pm UTC](https://www.ruby-forum.com/t/pure-ruby-app-that-receives-events/145480/2 "2008-08-10T17:46:27Z")

</div>

On 10 aug, 15:53, Perry S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Does anyone know if it is possible to have a Ruby application that  
> receives Apple Events? I assume it would be in an event loop. Really,  
> what I’m asking is if I can create a pure Ruby app that behaves like a  
> “first class” application as Apple has promised.

It may not be a bad idea to do a few standard Cocoa with Objective-C  
tutorials and familiarize yourself with the framework a bit.

If you want to use Ruby there is a Cocoa wrapper called RubyCocoa, it  
is supported by Apple:  
[http://developer.apple.com/documentation/Cocoa/Conceptual/RubyPythonCocoa/Introduction/Introduction.html](http://developer.apple.com/documentation/Cocoa/Conceptual/RubyPythonCocoa/Introduction/Introduction.html)

I found one article that seems to deal with events:

> **[RubyCocoa Rocks](http://codeintensity.blogspot.com/2008/01/rubycocoa-rocks.html)**
>
> My infatuation with RubyCocoa continues. I've been working on a small app for the Building Web Apps folks. I'd originally been tasked wit...

HTH

Francis

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [August 11, 2008, 4:31am UTC](https://www.ruby-forum.com/t/pure-ruby-app-that-receives-events/145480/3 "2008-08-11T04:31:14Z")

</div>

On Aug 10, 2008, at 3:20 PM, hengist podd wrote:

> HTH
> 
> ## has
> 
> Control AppleScriptable applications from Python, Ruby and ObjC:  
> [http://appscript.sourceforge.net](http://appscript.sourceforge.net)
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Also take a look at MacRuby  
It is still in it’s formative stages, but is the next level of  
bridging Ruby and Cocoa.

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [August 10, 2008, 10:22pm UTC](https://www.ruby-forum.com/t/pure-ruby-app-that-receives-events/145480/4 "2008-08-10T22:22:39Z")

</div>

Dolazy wrote:

> I found one article that seems to deal with events:  
> [http://codeintensity.blogspot.com/2008/01/rubycocoa-rocks.html](http://codeintensity.blogspot.com/2008/01/rubycocoa-rocks.html)

Installing event handlers via NSAppleEventManager is fine for simple  
tasks. For full-blown scripting interfaces that expose a query-able  
object model a-la Finder, Mail, etc., Cocoa Scripting would be more  
appropriate (if a bear to get right). Matt N. - who often lurks  
around this list - would be the best person to speak to.

HTH

## has

Control AppleScriptable applications from Python, Ruby and ObjC:  
[http://appscript.sourceforge.net](http://appscript.sourceforge.net)
