Women in Technology

Hear us Roar

  Replacing AppleScript with Ruby
Subject:   Can't include Appscript
Date:   2007-03-01 00:36:33
From:   stiang
Great article, but I got stuck when I wanted to try the examples. I installed via RubyGems, so I thought this would work:

irb(main):005:0> require "rubygems"
=> true
irb(main):006:0> gem "rb-appscript"
=> true
irb(main):007:0> include Appscript
NameError: uninitialized constant Appscript
from (irb):7
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:234

Am I doing something wrong?

Full Threads Oldest First

Showing messages 1 through 3 of 3.

  • Matt Neuburg photo Can't include Appscript
    2007-03-01 07:05:12  Matt Neuburg | O'Reilly AuthorO'Reilly Blogger [View]

    Hi, stiang - I don't have a good answer. With RubyGems, you're on your own. Try the installation method I described and see if that works better for you. The article describes the installation method that I was able to get to work. It doesn't talk about methods that I wasn't able to get to work.
    • Can't include Appscript
      2007-03-01 07:28:59  stiang [View]

      Thanks, the method you described does indeed work. I just thought I'd check that I wasn't doing something obviously wrong.

      On to the examples!
      • Can't include Appscript
        2007-05-25 17:09:19  devaulw [View]

        The following worked fine with the gem. Rubyforge has more info.

        #!/usr/bin/env ruby
        require 'rubygems'
        rescue LoadError
        require "appscript"
        include Appscript
        puts app('Finder').name.get