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!
Posted by evan on Friday, August 10, 2007
blog comments powered by Disqus
My name is Evan Light and, yes, I am a nerd. I'm also a professional software developer who, after spending one too many years contracting to the federal government, escaped into the far more enjoyable commercial world. Having spent several years using C and even more using Java (the latter very nearly caused me to give up programming entirely), I consider myself fortunate to have discovered Ruby and to use it as part of my daily work.