From laurent.sansonetti at gmail.com Tue Jan 2 10:28:05 2007 From: laurent.sansonetti at gmail.com (Laurent Sansonetti) Date: Tue, 2 Jan 2007 16:28:05 +0100 Subject: [Rubyosa-discuss] [ANN] RubyOSA 0.2.0 Message-ID: <1be7247c0701020728r71407448r832068d2bc42353@mail.gmail.com> Hi, I'm pleased to announce the second public release of RubyOSA, 0.2.0. RubyOSA is a bridge that connects Ruby to the Apple Event Manager infrastructure. In big words, it allows you to do in Ruby what you could do in AppleScript. It can either be installed via RubyGems (gem install rubyosa), or manually by building the sources. More information on the project home page (including a more deeply project description, samples etc...): http://rubyosa.rubyforge.org/ RubyOSA is still under heavy development, however you might already find it useful. Following are the release notes. Enjoy! Laurent Features: - Added support for some picture types ; - Possible to use UTF-8 strings (if OSA.utf8_strings is set to true) ; - Added new samples: Finder_show_desktop, BBEdit_unix_script, iTunes_artwork and iChat_images ; - Translate file paths, Hashes, floating types and missing types. Bugfixes: - Handle application errors and convert them as Ruby exceptions ; - Added 'class' to the list of reserved Ruby keywords to prefix when generating method parameters ; - Suffix method names that are already registered with an integer value instead of prefixing with 'osa_' as there might be more than 2 duplicates ; - Register the ID property if not already defined ; - Fixed conversion handlers to not use 'self' ; - Make sure to swap the data of 'type' coerced descriptors ; - Convert four char codes to the Mac Roman encoding before using them, as otherwise they could be considered as more-than-4-bytes strings ; - Remove invalid characters when generating constants ; - Changed the "require 'rubygems'..." expressions to make them compatible with Ruby 1.8.2 ; - Try to require 'rubygems' in samples, as RubyOSA may have been installed as a gem ; - Fixed generated code for methods taking an enumeration-like parameter. From jenspetr at gmail.com Wed Jan 3 17:21:31 2007 From: jenspetr at gmail.com (Jens-Petr Mikhailovich) Date: Wed, 3 Jan 2007 14:21:31 -0800 Subject: [Rubyosa-discuss] RuntimeError when saving downloaded artwork Message-ID: Hi All - After reading http://nslog.com/2006/09/24/itunes_artwork_in_id3/ I came up with a little trick to save downloaded iTunes artwork. Unfortunately after upgrading to rubyosa 0.2, it now generates a cryptic runtime error: RuntimeError: application returned error -1929379841 method __send_event__ in untitled document at line 2 method data= in untitled document at line 2 For the script: app = OSA.app('iTunes') for track in app.selection.get for art in track.artworks if art.downloaded? data = art.data art.data = data end end end Might anyone have an idea what is causing this? - jens -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubyosa-discuss/attachments/20070103/133e9249/attachment.html From lsansonetti at apple.com Thu Jan 4 08:33:24 2007 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Thu, 4 Jan 2007 14:33:24 +0100 Subject: [Rubyosa-discuss] RuntimeError when saving downloaded artwork In-Reply-To: References: Message-ID: <5EE84A3B-3281-427A-943D-8A78A8357B52@apple.com> Hi Jens, RubyOSA 0.2.0 now tries to catch application-level errors that are embedded in the result descriptor. It looks like iTunes didn't like the artwork data assignment, though the error code is a bit cryptic indeed. I can't reproduce this with user-provided artworks, I will try to manage to get some automatically downloaded artwork. Laurent On Jan 3, 2007, at 11:21 PM, Jens-Petr Mikhailovich wrote: > > Hi All - > > After reading http://nslog.com/2006/09/24/itunes_artwork_in_id3/ I > came up with a little trick to save downloaded iTunes artwork. > Unfortunately after upgrading to rubyosa 0.2, it now generates a > cryptic runtime error: > > RuntimeError: application returned error -1929379841 > method __send_event__ in untitled document at line 2 > method data= in untitled document at line 2 > > For the script: > app = OSA.app('iTunes') > for track in app.selection.get > for art in track.artworks > if art.downloaded? > data = art.data > art.data = data > end > end > end > > Might anyone have an idea what is causing this? > > - jens > _______________________________________________ > Rubyosa-discuss mailing list > Rubyosa-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyosa-discuss From jmacaulay at gmail.com Wed Jan 10 22:17:46 2007 From: jmacaulay at gmail.com (James MacAulay) Date: Wed, 10 Jan 2007 22:17:46 -0500 Subject: [Rubyosa-discuss] 'alis' revisited Message-ID: <651697BE-83E3-4CE1-9F96-76088C85DE38@gmail.com> First of all, thanks Laurent for your continuing work. I didn't do much coding over the holidays and I'm eager to further explore the 0.2.0 release. I love how everything is getting so user-friendly :) The first thing that I tried out was how 'alis' properties are being handled these days; it's great to see that they're being converted into something useful now. I think one further tweak is desirable for them, though: passing them through URI.unescape. Right now we're getting file paths with %20's all over the place instead of spaces, which doesn't really make sense when we aren't talking about a URI any more (and which File.new doesn't make sense of). Does that sound good? James From jmacaulay at gmail.com Wed Jan 10 22:44:18 2007 From: jmacaulay at gmail.com (James MacAulay) Date: Wed, 10 Jan 2007 22:44:18 -0500 Subject: [Rubyosa-discuss] Adding an iTunes track to a new playlist Message-ID: <87DBF1A3-F2AD-4CCA-8BF2-688DE717D0BF@gmail.com> This is also to do with 'alis' objects: I have just been looking for how to add an existing iTunes track to a new playlist, and found that OSA::ITunes::Application#add seems to be the only way to do it. Unfortunately, this method requires an 'alis' object, for which there seems to be no source except the tracks themselves via FileTrack#location, which of course RubyOSA now parses into a beautiful string :) I found a rather ugly way of getting the raw OSA::Element version of the 'location' property, like this: irb(main):047:0> OSA.replace_conversion_to_ruby('alis') {| value,type,object| object} => ["alis"] ... irb(main):049:0> track.location => # eewww :P ...but it works, at least: irb(main):051:0> app => # irb(main):052:0> p => # irb(main):053:0> app.add(track.location,p) => # (Variable 'p' here is the Party Shuffle, and the track was indeed added there.) But now there's the issue of getting that conversion-to-ruby back in place now that I'm done messing around with silly 'alis' objects, and so I would need to very non-DRY-ly do an OSA.add_conversion_to_ruby with the previous code, or insert an "attr_accessor :conversions_to_ruby" into the OSA module...etc...etc.... I hope I'm not just missing some already-existing elegant solution to this problem, but it seems that a really nice feature would be to have a somewhat reflective method that would work something like Object#send, like this: location = track.osa_obj(:location) ...where osa_obj is some method that returns the OSA::Element version of the property named by the string/symbol, without going through the conversion-to-ruby process. Thoughts? -James From laurent.sansonetti at gmail.com Thu Jan 11 07:43:09 2007 From: laurent.sansonetti at gmail.com (Laurent Sansonetti) Date: Thu, 11 Jan 2007 13:43:09 +0100 Subject: [Rubyosa-discuss] Fwd: 'alis' revisited In-Reply-To: <1be7247c0701110406p28aff0efx59122362cc248e16@mail.gmail.com> References: <651697BE-83E3-4CE1-9F96-76088C85DE38@gmail.com> <1be7247c0701110406p28aff0efx59122362cc248e16@mail.gmail.com> Message-ID: <1be7247c0701110443j3b2e513fq4f78d135b918d9e@mail.gmail.com> Oops, forgot to CC the list. ---------- Forwarded message ---------- From: Laurent Sansonetti Date: Jan 11, 2007 1:06 PM Subject: Re: [Rubyosa-discuss] 'alis' revisited To: James MacAulay Hi James, On 1/11/07, James MacAulay wrote: > First of all, thanks Laurent for your continuing work. I didn't do > much coding over the holidays and I'm eager to further explore the > 0.2.0 release. I love how everything is getting so user-friendly :) > > The first thing that I tried out was how 'alis' properties are being > handled these days; it's great to see that they're being converted > into something useful now. I think one further tweak is desirable for > them, though: passing them through URI.unescape. Right now we're > getting file paths with %20's all over the place instead of spaces, > which doesn't really make sense when we aren't talking about a URI > any more (and which File.new doesn't make sense of). > > Does that sound good? > Yes it does, definitely. I just merged your idea to SVN (r132). Thanks, Laurent From davidganzhorn at gmail.com Sat Jan 13 19:05:48 2007 From: davidganzhorn at gmail.com (David Ganzhorn) Date: Sat, 13 Jan 2007 19:05:48 -0500 Subject: [Rubyosa-discuss] Errors when gem installing rubyosa Message-ID: I'm getting errors that are beyond me when trying to gem install rubyosa. This is on an intel mac. marauder:~ david$ sudo gem install rubyosa Password: Building native extensions. This could take a while... create /usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/src/osx_ruby.h ... create /usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/src/osx_intern.h ... Makefile:126: warning: overriding commands for target `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' Makefile:124: warning: ignoring old commands for target `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' In file included from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:29, from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32, from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:125, from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20, from src/rbosa.h:33, from src/rbosa.c:29: /opt/local/lib/gcc42/gcc/i386-apple-darwin8.7.1/4.2.0/include/xmmintrin.h:35:3: error: #error "SSE instruction set not enabled" In file included from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32, from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:125, from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20, from src/rbosa.h:33, from src/rbosa.c:29: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:254: error: expected specifier-qualifier-list before '__m128' src/rbosa.c:93:40: warning: multi-character character constant src/rbosa.c:96:45: warning: multi-character character constant src/rbosa.c:99:45: warning: multi-character character constant src/rbosa.c:102:45: warning: multi-character character constant src/rbosa.c:106:63: warning: multi-character character constant src/rbosa.c:106:71: warning: multi-character character constant src/rbosa.c:156:26: warning: multi-character character constant src/rbosa.c:355:26: warning: multi-character character constant make: *** [rbosa.o] Error 1 Makefile:126: warning: overriding commands for target `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' Makefile:124: warning: ignoring old commands for target `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' In file included from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:29, from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32, from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:125, from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20, from src/rbosa.h:33, from src/rbosa.c:29: /opt/local/lib/gcc42/gcc/i386-apple-darwin8.7.1/4.2.0/include/xmmintrin.h:35:3: error: #error "SSE instruction set not enabled" In file included from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/DriverServices.h:32, from /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/CarbonCore.h:125, from /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:21, from /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20, from src/rbosa.h:33, from src/rbosa.c:29: /System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/MachineExceptions.h:254: error: expected specifier-qualifier-list before '__m128' src/rbosa.c:93:40: warning: multi-character character constant src/rbosa.c:96:45: warning: multi-character character constant src/rbosa.c:99:45: warning: multi-character character constant src/rbosa.c:102:45: warning: multi-character character constant src/rbosa.c:106:63: warning: multi-character character constant src/rbosa.c:106:71: warning: multi-character character constant src/rbosa.c:156:26: warning: multi-character character constant src/rbosa.c:355:26: warning: multi-character character constant make: *** [rbosa.o] Error 1 Makefile:126: warning: overriding commands for target `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' Makefile:124: warning: ignoring old commands for target `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' ruby extconf.rb install rubyosa checking for OSACopyScriptingDefinition()... yes checking for LSFindApplicationForInfo()... yes creating Makefile make gcc -I. -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.7.1 -I. -DHAVE_OSACOPYSCRIPTINGDEFINITION -DHAVE_LSFINDAPPLICATIONFORINFO -fno-common -O0 -pipe -fno-common -Wall -c src/rbosa.c make install gcc -I. -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.7.1 -I. -DHAVE_OSACOPYSCRIPTINGDEFINITION -DHAVE_LSFINDAPPLICATIONFORINFO -fno-common -O0 -pipe -fno-common -Wall -c src/rbosa.c make clean Successfully installed rubyosa-0.2.0 marauder:~ david$ From Tom.Spivey at nureg.de Fri Jan 5 11:21:30 2007 From: Tom.Spivey at nureg.de (Tom Spivey) Date: Fri, 5 Jan 2007 17:21:30 +0100 Subject: [Rubyosa-discuss] FileMaker Pro issues/questions, Adobe Photoshop CS2 issue Message-ID: <5B06351E-261F-4F69-BF14-DD9305EBA0AF@nureg.de> Dear Laurent et al, thanks for the good work on this project! I'm playing with FileMaker Pro again, rdoc-osa works now. Here is some code: > > require 'rubygems' # ; rescue LoadError; end > require 'rbosa' > > # OSA.set_params(:timeout => 20, :lazy_events => false) do > > begin > app = OSA.app_with_signature("FMP7") > > puts app.databases[1].count(OSA::FileMakerProAdvanced::Record) > puts app.databases[1].tables[0].name > puts app.databases[1].tables[1].count > (OSA::FileMakerProAdvanced::Record) > puts app.databases[1].tables[1].records[0].cells[0].cellvalue > > puts app.databases[1].tables[1].records[0].cells['id'].cellvalue Of course, this does not work, but if I wanted to use names of cells (or database), how would I do this? Also, how would I use the get_data method of OSA::FileMakerProAdvanced::Record ? In addition, Adobe Photoshop CS2 has parse issues, it seems? > rdoc-osa --signature 8BIM > /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/rbosa.rb:627:in > `__app__': (eval):3:in `__app__': compile error (SyntaxError) > (eval):1: duplicate optional argument name from /opt/local/lib/ > ruby/gems/1.8/gems/rubyosa-0.2.0/lib/rbosa.rb:624:in `each' > from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ > rbosa.rb:624:in `__app__' > from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ > rbosa.rb:524:in `each' > from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ > rbosa.rb:524:in `__app__' > from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ > rbosa.rb:213:in `app_with_signature' > from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/bin/ > rdoc-osa:71:in `send' > from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/bin/ > rdoc-osa:71 > from /opt/local/bin/rdoc-osa:18:in `load' > from /opt/local/bin/rdoc-osa:18 Cheers Tom > > ary = app.databases() > ary.each do |x| > puts x.name > # puts x.class > end > # puts ary[1].cells() > rescue Exception => e > puts "OSA Lauch App Error: #{e}" > end > From dancona at mat.uniroma1.it Fri Jan 19 02:31:15 2007 From: dancona at mat.uniroma1.it (Piero D'Ancona) Date: Fri, 19 Jan 2007 08:31:15 +0100 Subject: [Rubyosa-discuss] installation problem Message-ID: <32081CF4-36AD-4079-A4DE-F14961014F18@mat.uniroma1.it> Hi, sorry if this is too basic. I tried to install rubyOSA-0.2.0 on my PB with X.4.8. I thought my ruby installation was completely standard, but when I run extconf.rb I get the error "ruby.h not found". What should I do to install rubyOSA? Thank you, Piero From lrz at chopine.be Fri Jan 19 09:10:37 2007 From: lrz at chopine.be (Laurent Sansonetti) Date: Fri, 19 Jan 2007 15:10:37 +0100 Subject: [Rubyosa-discuss] FileMaker Pro issues/questions, Adobe Photoshop CS2 issue In-Reply-To: <5B06351E-261F-4F69-BF14-DD9305EBA0AF@nureg.de> References: <5B06351E-261F-4F69-BF14-DD9305EBA0AF@nureg.de> Message-ID: Hey Tom, On Jan 5, 2007, at 5:21 PM, Tom Spivey wrote: > Dear Laurent et al, > > thanks for the good work on this project! Thanks! > I'm playing with FileMaker Pro again, rdoc-osa works now. > > Here is some code: > >> >> require 'rubygems' # ; rescue LoadError; end >> require 'rbosa' >> >> # OSA.set_params(:timeout => 20, :lazy_events => false) do >> >> begin >> app = OSA.app_with_signature("FMP7") >> >> puts app.databases[1].count(OSA::FileMakerProAdvanced::Record) >> puts app.databases[1].tables[0].name >> puts app.databases[1].tables[1].count >> (OSA::FileMakerProAdvanced::Record) >> puts app.databases[1].tables[1].records[0].cells[0].cellvalue >> >> puts app.databases[1].tables[1].records[0].cells['id'].cellvalue > > Of course, this does not work, but if I wanted to use names of cells > (or database), how would I do this? It's not possible yet, but it will surely in one of the next releases. > Also, how would I use the get_data method of > OSA::FileMakerProAdvanced::Record ? > > In addition, Adobe Photoshop CS2 has parse issues, it seems? > >> rdoc-osa --signature 8BIM >> /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/rbosa.rb:627:in >> `__app__': (eval):3:in `__app__': compile error (SyntaxError) >> (eval):1: duplicate optional argument name from /opt/local/lib/ >> ruby/gems/1.8/gems/rubyosa-0.2.0/lib/rbosa.rb:624:in `each' >> from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ >> rbosa.rb:624:in `__app__' >> from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ >> rbosa.rb:524:in `each' >> from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ >> rbosa.rb:524:in `__app__' >> from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ >> rbosa.rb:213:in `app_with_signature' >> from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/bin/ >> rdoc-osa:71:in `send' >> from /opt/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/bin/ >> rdoc-osa:71 >> from /opt/local/bin/rdoc-osa:18:in `load' >> from /opt/local/bin/rdoc-osa:18 I will manage to get CS2 on a machine and fix this (and I will also see for the get_data command). I'm unfortunately busy on another project at the moment, but I will resume working on RubyOSA very soon. Cheers, Laurent From lrz at chopine.be Fri Jan 19 09:11:50 2007 From: lrz at chopine.be (Laurent Sansonetti) Date: Fri, 19 Jan 2007 15:11:50 +0100 Subject: [Rubyosa-discuss] installation problem In-Reply-To: <32081CF4-36AD-4079-A4DE-F14961014F18@mat.uniroma1.it> References: <32081CF4-36AD-4079-A4DE-F14961014F18@mat.uniroma1.it> Message-ID: <13B14543-05CF-4C05-8B39-FC223F679861@chopine.be> Hi Piero, I would bet that the Developer SDK hasn't been installed on your machine. Is 'gcc' there? If not, that's probably the cause. You may want to install the Developer package from the Mac OS X DVD. HTH, Laurent On Jan 19, 2007, at 8:31 AM, Piero D'Ancona wrote: > Hi, > sorry if this is too basic. I tried to install > rubyOSA-0.2.0 on my PB with X.4.8. > I thought my ruby installation was completely > standard, but when I run extconf.rb > I get the error "ruby.h not found". > What should I do to install rubyOSA? > Thank you, > Piero > > _______________________________________________ > Rubyosa-discuss mailing list > Rubyosa-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyosa-discuss From davidganzhorn at gmail.com Fri Jan 19 12:28:03 2007 From: davidganzhorn at gmail.com (David Ganzhorn) Date: Fri, 19 Jan 2007 12:28:03 -0500 Subject: [Rubyosa-discuss] Errors when gem installing rubyosa In-Reply-To: References: Message-ID: 10.4 On 1/19/07, Laurent Sansonetti wrote: > > Hi David, > > What's the version of Mac OS X? > > Thanks, > Laurent > > On Jan 14, 2007, at 1:05 AM, David Ganzhorn wrote: > > > I'm getting errors that are beyond me when trying to gem install > > rubyosa. This is on an intel mac. > > > > > > marauder:~ david$ sudo gem install rubyosa > > Password: > > Building native extensions. This could take a while... > > create /usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/src/ > > osx_ruby.h ... > > create /usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/src/ > > osx_intern.h ... > > Makefile:126: warning: overriding commands for target > > `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' > > Makefile:124: warning: ignoring old commands for target > > `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' > > In file included from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/MachineExceptions.h:29, > > from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/DriverServices.h:32, > > from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/CarbonCore.h:125, > > from > > /System/Library/Frameworks/CoreServices.framework/Headers/ > > CoreServices.h:21, > > from > > /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20, > > from src/rbosa.h:33, > > from src/rbosa.c:29: > > /opt/local/lib/gcc42/gcc/i386-apple-darwin8.7.1/4.2.0/include/ > > xmmintrin.h:35:3: > > error: #error "SSE instruction set not enabled" > > In file included from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/DriverServices.h:32, > > from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/CarbonCore.h:125, > > from > > /System/Library/Frameworks/CoreServices.framework/Headers/ > > CoreServices.h:21, > > from > > /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20, > > from src/rbosa.h:33, > > from src/rbosa.c:29: > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/MachineExceptions.h:254: > > error: expected specifier-qualifier-list before '__m128' > > src/rbosa.c:93:40: warning: multi-character character constant > > src/rbosa.c:96:45: warning: multi-character character constant > > src/rbosa.c:99:45: warning: multi-character character constant > > src/rbosa.c:102:45: warning: multi-character character constant > > src/rbosa.c:106:63: warning: multi-character character constant > > src/rbosa.c:106:71: warning: multi-character character constant > > src/rbosa.c:156:26: warning: multi-character character constant > > src/rbosa.c:355:26: warning: multi-character character constant > > make: *** [rbosa.o] Error 1 > > Makefile:126: warning: overriding commands for target > > `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' > > Makefile:124: warning: ignoring old commands for target > > `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' > > In file included from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/MachineExceptions.h:29, > > from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/DriverServices.h:32, > > from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/CarbonCore.h:125, > > from > > /System/Library/Frameworks/CoreServices.framework/Headers/ > > CoreServices.h:21, > > from > > /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20, > > from src/rbosa.h:33, > > from src/rbosa.c:29: > > /opt/local/lib/gcc42/gcc/i386-apple-darwin8.7.1/4.2.0/include/ > > xmmintrin.h:35:3: > > error: #error "SSE instruction set not enabled" > > In file included from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/DriverServices.h:32, > > from > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/CarbonCore.h:125, > > from > > /System/Library/Frameworks/CoreServices.framework/Headers/ > > CoreServices.h:21, > > from > > /System/Library/Frameworks/Carbon.framework/Headers/Carbon.h:20, > > from src/rbosa.h:33, > > from src/rbosa.c:29: > > /System/Library/Frameworks/CoreServices.framework/Frameworks/ > > CarbonCore.framework/Headers/MachineExceptions.h:254: > > error: expected specifier-qualifier-list before '__m128' > > src/rbosa.c:93:40: warning: multi-character character constant > > src/rbosa.c:96:45: warning: multi-character character constant > > src/rbosa.c:99:45: warning: multi-character character constant > > src/rbosa.c:102:45: warning: multi-character character constant > > src/rbosa.c:106:63: warning: multi-character character constant > > src/rbosa.c:106:71: warning: multi-character character constant > > src/rbosa.c:156:26: warning: multi-character character constant > > src/rbosa.c:355:26: warning: multi-character character constant > > make: *** [rbosa.o] Error 1 > > Makefile:126: warning: overriding commands for target > > `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' > > Makefile:124: warning: ignoring old commands for target > > `/usr/local/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib' > > ruby extconf.rb install rubyosa > > checking for OSACopyScriptingDefinition()... yes > > checking for LSFindApplicationForInfo()... yes > > creating Makefile > > > > make > > gcc -I. -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.7.1 -I. > > -DHAVE_OSACOPYSCRIPTINGDEFINITION -DHAVE_LSFINDAPPLICATIONFORINFO > > -fno-common -O0 -pipe -fno-common -Wall -c src/rbosa.c > > > > make install > > gcc -I. -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.7.1 -I. > > -DHAVE_OSACOPYSCRIPTINGDEFINITION -DHAVE_LSFINDAPPLICATIONFORINFO > > -fno-common -O0 -pipe -fno-common -Wall -c src/rbosa.c > > > > make clean > > Successfully installed rubyosa-0.2.0 > > marauder:~ david$ > > _______________________________________________ > > Rubyosa-discuss mailing list > > Rubyosa-discuss at rubyforge.org > > http://rubyforge.org/mailman/listinfo/rubyosa-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubyosa-discuss/attachments/20070119/6265c223/attachment-0001.html From eric at 5stops.com Tue Jan 23 01:37:06 2007 From: eric at 5stops.com (Eric Lindvall) Date: Mon, 22 Jan 2007 22:37:06 -0800 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes Message-ID: I've been experiencing two strange issues with the latest version of rubyosa. I used to be able to pass a String (filename) to OSA::ITunes::Application#add and have it add the file, but I now get: /opt/ruby/1.8.5-p2/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/rbosa.rb: 282:in `__new__': Invalid argument of type 'Array' (required: OSA::Element) (ArgumentError) /opt/ruby/1.8.5-p2/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ rbosa.rb:282:in `convert_to_osa' /opt/ruby/1.8.5-p2/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ rbosa.rb:119:in `from_rbobj' (eval):2:in `add' /Users/eric/src/itunes/sync-itunes.rb:61:in `update_directory' Another strange issue I've been seeing has been that a bunch of tracks that I used to be able to call OSA::Itunes::FileTrack#location on are now returning "gnsm" to "track.location.__data__.inspect". What sort of debugging info could I provide to help figure out what I'm doing wrong? From jmacaulay at gmail.com Tue Jan 23 02:36:43 2007 From: jmacaulay at gmail.com (James MacAulay) Date: Tue, 23 Jan 2007 02:36:43 -0500 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: References: Message-ID: <89202067-7717-4DFF-9D33-0C685D6DED22@gmail.com> On 23-Jan-07, at 1:37 AM | Jan 23, Eric Lindvall wrote: > I used to be able to pass a String (filename) to > OSA::ITunes::Application#add and have it add the file, but I now get: > ... I didn't realize that the add method ever allowed that. In any event, I recently asked about the logistics of adding tracks in iTunes. According to my records Laurent copied the list with his reply, but now I can't find it in the archives so perhaps it never made its way to the list at all. In any case, here's my original message: http://rubyforge.org/pipermail/rubyosa-discuss/2007-January/000071.html ...and here's Laurent's response from January 13, in case no one else got it: "I can see at least 2 problems here, the first being that paths are not converted to alias, and the second that location specifiers are still not supported. I will look at these as soon as I can (perhaps next week)." > Another strange issue I've been seeing has been that a bunch of > tracks that I used to be able to call OSA::Itunes::FileTrack#location > on are now returning "gnsm" to "track.location.__data__.inspect". > The location method (along with any others which represent file aliases) now returns a nice file path String instead of a nonsensical OSA object. But I'm puzzled by this "gnsm" thing that you're getting. I just updated to the latest trunk revision and I don't get this behaviour. Instead, I get a more mundane 'method not found' error, which is expected because track.location returns a String. Perhaps we aren't using exactly the same versions of RubyOSA; are you running off of the gem? James From eric at 5stops.com Tue Jan 23 11:54:14 2007 From: eric at 5stops.com (Eric Lindvall) Date: Tue, 23 Jan 2007 08:54:14 -0800 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: References: Message-ID: <43D513D7-5383-48A4-B9E8-1CE79D9412AA@5stops.com> For most tracks calling "track.location" worked great, but I have about 10 tracks that were always returning "#" when I called #location. I had been using the hack: OSA.add_conversion_to_ruby('alis') { |value, type, object| object.__data__('furl') } before upgrading to the latest gem (0.2.0) and everything had been working (including calling #add with a string), but after the upgrade, both of these things broke. On Jan 22, 2007, at 11:33 PM, jeanpierre at gmail.com wrote: > On 1/22/07, Eric Lindvall wrote: > [?] > > Another strange issue I've been seeing has been that a bunch of > tracks that I used to be able to call OSA::Itunes::FileTrack#location > on are now returning "gnsm" to "track.location.__data__.inspect". > > rather than coercing the value, you should be able to access it > directly now. if you already have a FileTrack you can just message > it with location and it should give you a valid filepath > > >> tracks = OSA.app('iTunes').selection.get > # => [#] > > >> tracks[0].location > # => "/Volumes/merckx/VAULT/Charlie/Space Woman.mp3" > > if you have a Track you can message it with get then location > > >> track = OSA.app('iTunes').current_track > # => # > > >> track.get.location > # => "/Volumes/merckx/VAULT/Charlie/Space Woman.mp3" > > not sure about your other issue :0) > > cheers, > jean-pierre -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rubyosa-discuss/attachments/20070123/420bd80d/attachment.html From eric at 5stops.com Tue Jan 23 11:55:13 2007 From: eric at 5stops.com (Eric Lindvall) Date: Tue, 23 Jan 2007 08:55:13 -0800 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: <89202067-7717-4DFF-9D33-0C685D6DED22@gmail.com> References: <89202067-7717-4DFF-9D33-0C685D6DED22@gmail.com> Message-ID: <5E117151-ABC2-4C99-BB01-EE3FD657FEB8@5stops.com> I had been running the gem before 0.2.0 and then upgraded to 0.2.0 when it came out. Should I be running the trunk instead? On Jan 22, 2007, at 11:36 PM, James MacAulay wrote: > > On 23-Jan-07, at 1:37 AM | Jan 23, Eric Lindvall wrote: >> I used to be able to pass a String (filename) to >> OSA::ITunes::Application#add and have it add the file, but I now get: >> ... > > I didn't realize that the add method ever allowed that. In any event, > I recently asked about the logistics of adding tracks in iTunes. > According to my records Laurent copied the list with his reply, but > now I can't find it in the archives so perhaps it never made its way > to the list at all. In any case, here's my original message: > > http://rubyforge.org/pipermail/rubyosa-discuss/2007-January/ > 000071.html > > ...and here's Laurent's response from January 13, in case no one else > got it: > > "I can see at least 2 problems here, the first being that paths are > not converted to alias, and the second that location specifiers are > still not supported. I will look at these as soon as I can (perhaps > next week)." > >> Another strange issue I've been seeing has been that a bunch of >> tracks that I used to be able to call OSA::Itunes::FileTrack#location >> on are now returning "gnsm" to "track.location.__data__.inspect". >> > > The location method (along with any others which represent file > aliases) now returns a nice file path String instead of a nonsensical > OSA object. But I'm puzzled by this "gnsm" thing that you're getting. > I just updated to the latest trunk revision and I don't get this > behaviour. Instead, I get a more mundane 'method not found' error, > which is expected because track.location returns a String. Perhaps we > aren't using exactly the same versions of RubyOSA; are you running > off of the gem? > > James > > _______________________________________________ > Rubyosa-discuss mailing list > Rubyosa-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyosa-discuss From jmacaulay at gmail.com Tue Jan 23 12:44:55 2007 From: jmacaulay at gmail.com (James MacAulay) Date: Tue, 23 Jan 2007 12:44:55 -0500 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: <43D513D7-5383-48A4-B9E8-1CE79D9412AA@5stops.com> References: <43D513D7-5383-48A4-B9E8-1CE79D9412AA@5stops.com> Message-ID: <6E9F34BF-D2CF-4C39-9748-789C3F7EF52B@gmail.com> > I had been running the gem before 0.2.0 and then upgraded to 0.2.0 > when it came out. > > Should I be running the trunk instead? I don't know enough about the differences right now between the gem and the SVN versions to say if it matters, but I don't think it would. On 23-Jan-07, at 11:54 AM | Jan 23, Eric Lindvall wrote: > For most tracks calling "track.location" worked great, but I have > about 10 tracks that were always returning "# 0x63dd78>" when I called #location. > > I had been using the hack: > OSA.add_conversion_to_ruby('alis') { |value, type, object| > object.__data__('furl') } > > before upgrading to the latest gem (0.2.0) and everything had been > working (including calling #add with a string), but after the > upgrade, both of these things broke. > > So you only get this "gnsm" value when you're using the hack? That would make a bit more sense then. Is there nothing special about those FileTracks? I know that, for instance, podcasts which aren't downloaded yet will get resolved as URLTracks instead of FileTracks, and they won't have a location attribute. Some similar situation may be going on here. James From lsansonetti at apple.com Tue Jan 23 13:03:55 2007 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Tue, 23 Jan 2007 19:03:55 +0100 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: References: Message-ID: Hi Eric, Thanks for the report, you're unfortunately not the first one :) I have a potential fix for this problem but didn't have the chance to integrate it in the repository, as I got busy on something else. But I will try to work on this later this week and write on the list once this issue will be solved. Thanks, Laurent On Jan 23, 2007, at 7:37 AM, Eric Lindvall wrote: > I've been experiencing two strange issues with the latest version of > rubyosa. > > I used to be able to pass a String (filename) to > OSA::ITunes::Application#add and have it add the file, but I now get: > > /opt/ruby/1.8.5-p2/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/rbosa.rb: > 282:in `__new__': Invalid argument of type 'Array' (required: > OSA::Element) (ArgumentError) > /opt/ruby/1.8.5-p2/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ > rbosa.rb:282:in `convert_to_osa' > /opt/ruby/1.8.5-p2/lib/ruby/gems/1.8/gems/rubyosa-0.2.0/lib/ > rbosa.rb:119:in `from_rbobj' > (eval):2:in `add' > /Users/eric/src/itunes/sync-itunes.rb:61:in > `update_directory' > > > Another strange issue I've been seeing has been that a bunch of > tracks that I used to be able to call OSA::Itunes::FileTrack#location > on are now returning "gnsm" to "track.location.__data__.inspect". > > What sort of debugging info could I provide to help figure out what > I'm doing wrong? > > _______________________________________________ > Rubyosa-discuss mailing list > Rubyosa-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyosa-discuss From eric at 5stops.com Wed Jan 24 02:15:50 2007 From: eric at 5stops.com (Eric Lindvall) Date: Tue, 23 Jan 2007 23:15:50 -0800 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: <6E9F34BF-D2CF-4C39-9748-789C3F7EF52B@gmail.com> References: <43D513D7-5383-48A4-B9E8-1CE79D9412AA@5stops.com> <6E9F34BF-D2CF-4C39-9748-789C3F7EF52B@gmail.com> Message-ID: <6BFE4319-46ED-4C0A-A5DF-37C484F6222A@5stops.com> Before the latest 0.2.0 version, I was having to use the "alis" hack. With version 0.2.0, I no longer needed to (so I commented it out). I found that certain tracks return the OSA::Element when I call #location instead of a string. For those tracks that returned an OSA::Element, I printed out the "location.__data__.inspect" for informational purposes and found it was responding with "gnsm". I will double-check what tracks were responding with that to see if it really is a different kind of track. e. On Jan 23, 2007, at 9:44 AM, James MacAulay wrote: >> I had been running the gem before 0.2.0 and then upgraded to 0.2.0 >> when it came out. >> >> Should I be running the trunk instead? > > I don't know enough about the differences right now between the gem > and the SVN versions to say if it matters, but I don't think it would. > > > On 23-Jan-07, at 11:54 AM | Jan 23, Eric Lindvall wrote: > >> For most tracks calling "track.location" worked great, but I have >> about 10 tracks that were always returning "#> 0x63dd78>" when I called #location. >> >> I had been using the hack: >> OSA.add_conversion_to_ruby('alis') { |value, type, object| >> object.__data__('furl') } >> >> before upgrading to the latest gem (0.2.0) and everything had been >> working (including calling #add with a string), but after the >> upgrade, both of these things broke. >> >> > > > So you only get this "gnsm" value when you're using the hack? That > would make a bit more sense then. Is there nothing special about > those FileTracks? I know that, for instance, podcasts which aren't > downloaded yet will get resolved as URLTracks instead of FileTracks, > and they won't have a location attribute. Some similar situation may > be going on here. > > James > > _______________________________________________ > Rubyosa-discuss mailing list > Rubyosa-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyosa-discuss From jmacaulay at gmail.com Wed Jan 24 12:00:57 2007 From: jmacaulay at gmail.com (James MacAulay) Date: Wed, 24 Jan 2007 12:00:57 -0500 Subject: [Rubyosa-discuss] Fwd: [Rubycocoa-talk] subtlety rss feeds References: Message-ID: It doesn't look like this made its way to this list yet, so FYI: Begin forwarded message: > From: jeanpierre at gmail.com > Date: January 23, 2007 11:24:52 PM EST (CA) > To: rubycocoa-talk at lists.sourceforge.net > Subject: [Rubycocoa-talk] subtlety rss feeds > Reply-To: rubycocoa-talk at lists.sourceforge.net > > hi all - > > for those of you closely watching commits, i made some rss feeds > out of the rubycocoa and rubyosa subversion repositories using > subtlety: > > rubycocoa: > rubyosa: > > cheers, > jean-pierre > From lsansonetti at apple.com Thu Jan 25 12:54:35 2007 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Thu, 25 Jan 2007 18:54:35 +0100 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: <6BFE4319-46ED-4C0A-A5DF-37C484F6222A@5stops.com> References: <43D513D7-5383-48A4-B9E8-1CE79D9412AA@5stops.com> <6E9F34BF-D2CF-4C39-9748-789C3F7EF52B@gmail.com> <6BFE4319-46ED-4C0A-A5DF-37C484F6222A@5stops.com> Message-ID: <790E893F-A9A3-4002-B871-7E38C91419A8@apple.com> Hi Eric, James, I fixed the ITunes::Application#add problem (it was a regression introduced by some refactoring). To make sure it won't happen again I created a set of test cases (which I should have done at the beginning) and this specific feature is now part of them. Could you check out the latest SVN revision and tell me if it's fixed for you? http://rubyforge.org/scm/?group_id=1845 About the OSA::Element objects returned by #location, I will investigate the 'gnsm' type. In the meantime, could you verify that the problem still persists with the SVN version? Thanks a lot, Laurent On Jan 24, 2007, at 8:15 AM, Eric Lindvall wrote: > Before the latest 0.2.0 version, I was having to use the "alis" hack. > > With version 0.2.0, I no longer needed to (so I commented it out). > > I found that certain tracks return the OSA::Element when I call > #location instead of a string. > > For those tracks that returned an OSA::Element, I printed out the > "location.__data__.inspect" for informational purposes and found it > was responding with "gnsm". > > I will double-check what tracks were responding with that to see if > it really is a different kind of track. > > e. > > > On Jan 23, 2007, at 9:44 AM, James MacAulay wrote: > >>> I had been running the gem before 0.2.0 and then upgraded to 0.2.0 >>> when it came out. >>> >>> Should I be running the trunk instead? >> >> I don't know enough about the differences right now between the gem >> and the SVN versions to say if it matters, but I don't think it >> would. >> >> >> On 23-Jan-07, at 11:54 AM | Jan 23, Eric Lindvall wrote: >> >>> For most tracks calling "track.location" worked great, but I have >>> about 10 tracks that were always returning "#>> 0x63dd78>" when I called #location. >>> >>> I had been using the hack: >>> OSA.add_conversion_to_ruby('alis') { |value, type, object| >>> object.__data__('furl') } >>> >>> before upgrading to the latest gem (0.2.0) and everything had been >>> working (including calling #add with a string), but after the >>> upgrade, both of these things broke. >>> >>> >> >> >> So you only get this "gnsm" value when you're using the hack? That >> would make a bit more sense then. Is there nothing special about >> those FileTracks? I know that, for instance, podcasts which aren't >> downloaded yet will get resolved as URLTracks instead of FileTracks, >> and they won't have a location attribute. Some similar situation may >> be going on here. >> >> James >> >> _______________________________________________ >> Rubyosa-discuss mailing list >> Rubyosa-discuss at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rubyosa-discuss > > _______________________________________________ > Rubyosa-discuss mailing list > Rubyosa-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyosa-discuss From lsansonetti at apple.com Thu Jan 25 12:57:21 2007 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Thu, 25 Jan 2007 18:57:21 +0100 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: <790E893F-A9A3-4002-B871-7E38C91419A8@apple.com> References: <43D513D7-5383-48A4-B9E8-1CE79D9412AA@5stops.com> <6E9F34BF-D2CF-4C39-9748-789C3F7EF52B@gmail.com> <6BFE4319-46ED-4C0A-A5DF-37C484F6222A@5stops.com> <790E893F-A9A3-4002-B871-7E38C91419A8@apple.com> Message-ID: <253B3B62-8B47-44DD-B33F-0A3306622E67@apple.com> On Jan 25, 2007, at 6:54 PM, Laurent Sansonetti wrote: > About the OSA::Element objects returned by #location, I will > investigate the 'gnsm' type. In the meantime, could you verify that > the problem still persists with the SVN version? When I hit 'Send' I realized that this 'gnsm' code may be a endianness issue (the reverse being 'msng', which is a valid code). There might be some place in the core where we don't properly convert the four char codes to little endian :-) Laurent From eric at 5stops.com Thu Jan 25 13:06:43 2007 From: eric at 5stops.com (Eric Lindvall) Date: Thu, 25 Jan 2007 10:06:43 -0800 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: <253B3B62-8B47-44DD-B33F-0A3306622E67@apple.com> References: <43D513D7-5383-48A4-B9E8-1CE79D9412AA@5stops.com> <6E9F34BF-D2CF-4C39-9748-789C3F7EF52B@gmail.com> <6BFE4319-46ED-4C0A-A5DF-37C484F6222A@5stops.com> <790E893F-A9A3-4002-B871-7E38C91419A8@apple.com> <253B3B62-8B47-44DD-B33F-0A3306622E67@apple.com> Message-ID: Now that you say that, I did see reference to an endian bug in the python OSA library where someone found the exact same code. On Jan 25, 2007, at 9:57 AM, Laurent Sansonetti wrote: > > On Jan 25, 2007, at 6:54 PM, Laurent Sansonetti wrote: > >> About the OSA::Element objects returned by #location, I will >> investigate the 'gnsm' type. In the meantime, could you verify >> that the problem still persists with the SVN version? > > When I hit 'Send' I realized that this 'gnsm' code may be a > endianness issue (the reverse being 'msng', which is a valid code). > There might be some place in the core where we don't properly > convert the four char codes to little endian :-) > > Laurent From jmacaulay at gmail.com Thu Jan 25 17:16:32 2007 From: jmacaulay at gmail.com (James MacAulay) Date: Thu, 25 Jan 2007 17:16:32 -0500 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: <790E893F-A9A3-4002-B871-7E38C91419A8@apple.com> References: <43D513D7-5383-48A4-B9E8-1CE79D9412AA@5stops.com> <6E9F34BF-D2CF-4C39-9748-789C3F7EF52B@gmail.com> <6BFE4319-46ED-4C0A-A5DF-37C484F6222A@5stops.com> <790E893F-A9A3-4002-B871-7E38C91419A8@apple.com> Message-ID: <120D4660-07D4-4B3E-AC5E-816AD085A55D@gmail.com> On 25-Jan-07, at 12:54 PM | Jan 25, Laurent Sansonetti wrote: > Hi Eric, James, > > I fixed the ITunes::Application#add problem (it was a regression > introduced by some refactoring). To make sure it won't happen again > I created a set of test cases (which I should have done at the > beginning) and this specific feature is now part of them. > > Could you check out the latest SVN revision and tell me if it's > fixed for you? > Works great! Thanks very much. For the edification of present and future list lurkers, here's how you can now nicely add an existing track to the party shuffle, for example: app = OSA.app('itunes') ps = app.sources[0].playlists.find {|p| p.name == 'Party Shuffle'} track = app.sources[0].library_playlists[0].tracks[555] app.add(track.get.location,ps) And then you can use the same method to add a completely new file to the library: app.add('/Users/jmacaulay/Desktop/some-radical-and-subversive- film.mov',app.sources[0].library_playlists[0]) -James From eric at 5stops.com Mon Jan 29 04:03:21 2007 From: eric at 5stops.com (Eric Lindvall) Date: Mon, 29 Jan 2007 01:03:21 -0800 Subject: [Rubyosa-discuss] Listing and adding tracks in iTunes In-Reply-To: <120D4660-07D4-4B3E-AC5E-816AD085A55D@gmail.com> References: <43D513D7-5383-48A4-B9E8-1CE79D9412AA@5stops.com> <6E9F34BF-D2CF-4C39-9748-789C3F7EF52B@gmail.com> <6BFE4319-46ED-4C0A-A5DF-37C484F6222A@5stops.com> <790E893F-A9A3-4002-B871-7E38C91419A8@apple.com> <120D4660-07D4-4B3E-AC5E-816AD085A55D@gmail.com> Message-ID: I can confirm -- the add calls are now working great. Also, all of the "gnsm" files were files that were not on the filesystem -- so in the end it didn't really matter anyways. Thanks for the fix! e. On Jan 25, 2007, at 2:16 PM, James MacAulay wrote: > > On 25-Jan-07, at 12:54 PM | Jan 25, Laurent Sansonetti wrote: > >> Hi Eric, James, >> >> I fixed the ITunes::Application#add problem (it was a regression >> introduced by some refactoring). To make sure it won't happen again >> I created a set of test cases (which I should have done at the >> beginning) and this specific feature is now part of them. >> >> Could you check out the latest SVN revision and tell me if it's >> fixed for you? >> > > > Works great! Thanks very much. For the edification of present and > future list lurkers, here's how you can now nicely add an existing > track to the party shuffle, for example: > > app = OSA.app('itunes') > ps = app.sources[0].playlists.find {|p| p.name == 'Party Shuffle'} > track = app.sources[0].library_playlists[0].tracks[555] > app.add(track.get.location,ps) > > And then you can use the same method to add a completely new file to > the library: > > app.add('/Users/jmacaulay/Desktop/some-radical-and-subversive- > film.mov',app.sources[0].library_playlists[0]) > > -James > _______________________________________________ > Rubyosa-discuss mailing list > Rubyosa-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyosa-discuss From lsansonetti at apple.com Mon Jan 29 11:11:41 2007 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Mon, 29 Jan 2007 17:11:41 +0100 Subject: [Rubyosa-discuss] location references, optional parameters Message-ID: <8B7AB7AF-1DD3-4BAF-BA27-E9CC7990C4F2@apple.com> Hey guys, I just added some nice stuff to SVN. If you can check them out, it would be great. I plan to make a new release very soon. 1/ More support for location references You should now be able to specify a location as it's either before or after a specific object. Example: w = textedit.documents[0].paragraphs[0].words w[2].duplicate(w[0].after) w[0].duplicate(w[1].before) You can use #before and #after on every object that inherits from OSA::Element. 2/ Optional parameters as an inline Hash syntax It's now possible to specify optional parameters using an inline Hash syntax. Example: OSA.app('iTunes').play(false) OSA.app('iTunes').play(:once => false) # NEW It can be very useful when a given method as lots of optional parameters and when you just want to specify some of them. You don't have to pass several nil values anymore, and you can just use an inline Hash object. OSA.app('TextEdit').make(OSA::TextEdit::Document, nil, nil, {:ctxt => 'foo'}) OSA.app('TextEdit').make(OSA::TextEdit::Document, :with_properties => {:ctxt => 'foo'}) 3/ Fastest engine I removed all code evaluation expressions and replaced them with appropriate calls to the Ruby runtime. RubyOSA should be a bit faster. Enjoy :) Laurent From lsansonetti at apple.com Mon Jan 29 19:39:15 2007 From: lsansonetti at apple.com (Laurent Sansonetti) Date: Tue, 30 Jan 2007 01:39:15 +0100 Subject: [Rubyosa-discuss] sdef merging, API changes Message-ID: <14148D8B-9954-40F2-B1B4-99ECEF7E12C0@apple.com> Hey, Again, some information about today's SVN activity. 1) sdef merging It's now possible to merge a given scriptable definition into the current application object. A #merge method has been added for this. Example: ichat = OSA.app('iChat') ichat.merge(:by_path => '/System/Library/ScriptingAdditions/ StandardAdditions.osax') ichat.beep(4) # will beep 4 times #merge also accepts :by_name, :by_bundle_id and :by_signature key/ values. 2/ API change The OSA.app() method can now accept an inline Hash syntax similar to the #merge method introduced earlier. Example: OSA.app('iTunes') # still working OSA.app(:by_name => 'iTunes') # same as OSA.app('iTunes') OSA.app(:by_path => '/Applications/iTunes.app') OSA.app(:by_bundle_id => 'com.apple.iTunes') OSA.app(:by_signature => 'hook') The old OSA.app_with_* methods have been deprecated. They are still working but you will get a warning message in the terminal suggesting you to move to the new syntax. Enjoy, Laurent