It should at least be doing something like this: http://porkrind.org/missives/calling-applescript-from-ruby/