Pastie from the Mac Clipboard

Giles Bowkett brought us Pastie of the Mac clipboard from IRB via the Utility Belt gem. If you aren’t using it already, ’sudo gem install utility_belt’. I highly recommend it.

That said, I’ve since longed for the same capability but from the command line.

Continue reading →

RubyOSA presentation to Northern Virginia Ruby Users Group

This evening’s NoVaRUG was a good time. Rodney Degracia spoke first about RubyCLR, which provides a dynamically generated bridge between a Ruby VM and the RubyCLR. If I ever need to get at .NET internals again, now I know how I’m going to do it. In fact, I dropped an e-mail to a colleague in the office about it — except that his assembly is executed from Python. A quick Google turned up “Python for .NET” as an option.

Then it was my turn to talk to RubyOSA and RB-AppScript.  Admittedly, after using both, I'm strongly biased toward RubyOSA.  I have the distinct feeling that, after my presentation, the audience felt the same way.

Well, the Mac users in the audience.

Out of twenty or so people in the room, it turned out that I was really presenting to perhaps five or six Mac users.  I suppose that RailsConf is in no way representative of your average Right Coast Ruby developer.  However, oddly, nearly everyone stayed for my presentation.  I even fielded several good questions.  All in all, I had a blast.

When Xandy asked for topics for next time, I asked if someone would present on RSpec.  His next words were, "Thanks for volunteering, Evan."

Time to learn RSpec...

Slides available here: OS X Scripting with Ruby

Return values in RubyOSA

While holding the Ruby Hoedown BoF about RubyOSA and AppScript, I mentioned how I’ve never gotten a return value out of RubyOSA — which is why I used AppScript when I needed a return value.

Shoot me now.

A quick google of “rubyosa applescript return value” yielded this post to ruby-talk-google. Woops…

It’s this simple:

require 'rubygems'
require 'rbosa'
skype = OSA.app('Skype')
OSA.wait_reply = true
call = skype.send2 "call echo123"

And call is non-nil.

Admittedly, I’m somewhat at a loss as to why wait_reply is defaulted to nil…

Update 8/11/04 1609: Laurent tells me that, if the Applescript definition is correct, RubyOSA should correctly provide return values. Chalk that up as yet another bug in the Skype Applescript API. I’ll report it soon (it’s going into iGTD now…).

– Thanks, Laurent!