From: Stephen Schor Date: 2008-01-03T07:17:19+09:00 Subject: Re: Automating OS X with Ruby. ------=_Part_19117_17279209.1199312243104 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Sorry about the copy and paste error. Laurent Sansonetti's post can be found here (http://rubyforge.org/pipermail/rubyosa-discuss/2006-October.txt) It's the message sent " Sat, 28 Oct 2006 23:37:25 +0200"... "After a quick investigation it revealed that QuickTime Player.app doesn't wake up when we request its scriptable definition, for the reason that it uses the old aete mechanism and that the sdef is generated on the fly, without the need to actually start and ask the application. However from a RubyOSA perspective, we should probably ensure that the given application is active after an OSA.app call" On Dec 25, 2007 6:29 PM, Stephen Schor wrote: > Thanks for all the replies. Calling .activate() isn't working for > me...but > opening it though the shell with > system("open -a 'itunes'") will work for now. Here's a snippet from the > IRB > session: > > >> require 'rbosa' > => true > >> i_chat = OSA.app('iTunes') > => > >> i_chat.activate > RuntimeError: Cannot send Apple Event 'miscactv' : procNotFound > (-600) > from /Library/Ruby/Gems/1.8/gems/rubyosa-0.4.0/lib/rbosa.rb:796:in > `__send_event__' > from /Library/Ruby/Gems/1.8/gems/rubyosa-0.4.0/lib/rbosa.rb:796:in > `activate' > > However - after a bit of searching I found what looks to be a related post > by *Laurent Sansonetti *in Rubyosa mailing list. > (http://mail.google.com/mail/?hl=en&tab=wm#inbox/1170f53ede402ae8) about > why > calling OSA.app('blah') on certain applications won't > launch them. > > -Stephen > > > On Dec 25, 2007 5:08 PM, Dane Jensen wrote: > > > On Dec 25, 2007, at 3:55 AM, Ryan Davis > > wrote: > > > > > > > > On Dec 24, 2007, at 19:23 , Stephen Schor wrote: > > > > > >> However - I can't interact with the *itunes* object unless I > > >> manually open > > >> the application. > > >> After I manually open it - I can call nifty methods like itunes.play > > >> () and > > >> itunes.stop(). > > >> I tried calling itunes.open() but that wouldn't launch the > > >> application. > > > > > > I dunno about rubyosa, but applescript uses 'activate'. > > > > Indeed. itunes.activate will start it if it's not open. > > > > > > > ------=_Part_19117_17279209.1199312243104--