[Rubyosa-discuss] Listing and adding tracks in iTunes trouble - 0.3.0.1
Laurent Sansonetti
lsansonetti at apple.com
Thu Mar 29 14:17:46 EDT 2007
Hi Eoin,
At a glance this looks like an old problem that has been fixed in
RubyOSA 0.3.0. Just to know, are you sure you don't have an older
version installed on your machine? For example, if you installed 0.3.0
using RubyGems, are you sure there isn't an old version that has been
installed manually in the system (e.g. in /usr/lib/ruby/site_ruby)?
Ruby would load the version in site_ruby in priority then.
Laurent
On Mar 29, 2007, at 3:40 PM, Eoin Brazil wrote:
> I have been trying to use the code from James MacAulay (
> http://rubyforge.org/pipermail/rubyosa-discuss/2007-January/000090.html)
> in
> order to be able to pass a String (filename) to
> OSA::ITunes::Application#add
> and I've been getting some errors. Can anyone tell me what I'm doing
> wrong
> or what I need to do to correct the errors ?
>
> I've include the details and the code that I'm using below.
>
> Thanks, Eoin
>
> Platfrom: Mac OS X 10.4.8 build 8L127
> Ruby: ruby 1.8.5 (2006-08-25) [powerpc-darwin8.7.0]
> RubyOSA: Gem version of rubyosa (0.3.0.1, 0.2.0, 0.1.0) with
> rubygems 0.9.0
>
> ---Command prompt output:
>
> ****:~/Desktop/useridsounds/possibleuseridsounds/sids username$ ruby
> test.rb
> /usr/local/lib/ruby/site_ruby/1.8/rbosa.rb:282:in `__new__': Invalid
> argument of type 'Array' (required: OSA::Element) (ArgumentError)
> from /usr/local/lib/ruby/site_ruby/1.8/rbosa.rb:282:in
> `convert_to_osa'
> from /usr/local/lib/ruby/site_ruby/1.8/rbosa.rb:119:in
> `from_rbobj'
> from (eval):2:in `add'
> from test.rb:12
>
> ---Test.rb:
>
> #!/usr/bin/env ruby
> #
>
> begin require 'rubygems'; rescue LoadError; end
> require 'rbosa'
>
> app = OSA.app('itunes')
> ps = app.sources[0].playlists.find {|p| p.name == 'Party Shuffle'}
> track = app.sources[0].library_playlists[0].tracks[25]
> app.add(track.get.location,ps)
>
>
> _______________________________________________
> Rubyosa-discuss mailing list
> Rubyosa-discuss at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rubyosa-discuss
More information about the Rubyosa-discuss
mailing list