From gabi_cojo at mac.com Sun Apr 6 23:58:50 2008 From: gabi_cojo at mac.com (Gabriel Cojocariu) Date: Sun, 6 Apr 2008 23:58:50 -0400 Subject: [Rubyosa-discuss] RubyOSA Finder Scripting Message-ID: <31651180-6E3E-4B6F-ABC8-2D56E6FB9671@mac.com> Hello, I am just starting with Ruby and RubyOSA so please excuse the "naivety" at times... I'm trying to script Finder under OS X Leopard 10.5.2. Because I use dialogs I merge Standard Additions. My problem is the following: - I use choose_folder method - the type returned by choose_folder is String - I need to make it a Folder object reference, to be used as argument in following make or move methods. Any help would be appreciated, Gabriel From bdotdub at gmail.com Sat Apr 26 21:25:13 2008 From: bdotdub at gmail.com (Benny Wong) Date: Sat, 26 Apr 2008 21:25:13 -0400 Subject: [Rubyosa-discuss] Open URL in Default Browser Message-ID: Hi everyone, I've been poking around the 'System Events' application using RubyOSA and I haven't been able to find a way to simply open a URL in the default browser, ie. how would i do: tell application "System Events" open location "http://google.com/search?q=" & s end tell Has anyone come across this? Any help would be great. Thanks! Cheers, Benny -------------- next part -------------- An HTML attachment was scrubbed... URL: From jonbaer at gmail.com Sat Apr 26 22:30:26 2008 From: jonbaer at gmail.com (Jon Baer) Date: Sat, 26 Apr 2008 22:30:26 -0400 Subject: [Rubyosa-discuss] Open URL in Default Browser In-Reply-To: References: Message-ID: <08D15D50-2128-4902-B670-97AA5556C749@gmail.com> Hmm not sure about RubyOSA but something like this would work w/ RubyCocoa: require 'osx/cocoa' @url = OSX::NSURL.URLWithString("http://google.com/search?q=Ruby") OSX::NSWorkspace.sharedWorkspace.openURL(@url) - Jon On Apr 26, 2008, at 9:25 PM, Benny Wong wrote: > Hi everyone, > > I've been poking around the 'System Events' application using > RubyOSA and I > haven't been able to find a way to simply open a URL in the default > browser, > ie. how would i do: > > tell application "System Events" > open location "http://google.com/search?q=" & s > end tell > > Has anyone come across this? Any help would be great. Thanks! > > Cheers, > Benny > _______________________________________________ > Rubyosa-discuss mailing list > Rubyosa-discuss at rubyforge.org > http://rubyforge.org/mailman/listinfo/rubyosa-discuss From schapht at gmail.com Sun Apr 27 00:53:30 2008 From: schapht at gmail.com (Mat Schaffer) Date: Sun, 27 Apr 2008 00:53:30 -0400 Subject: [Rubyosa-discuss] Open URL in Default Browser In-Reply-To: References: Message-ID: On Apr 26, 2008, at 9:25 PM, Benny Wong wrote: > I've been poking around the 'System Events' application using > RubyOSA and I haven't been able to find a way to simply open a URL > in the default browser, ie. how would i do: > > tell application "System Events" > open location "http://google.com/search?q=" & s > end tell > > Has anyone come across this? Any help would be great. Thanks! This almost feels like a cop-out, but I would also consider `open #{url}` just for sake of simplicity. -Mat -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremy at hinegardner.org Sat Apr 26 22:56:44 2008 From: jeremy at hinegardner.org (Jeremy Hinegardner) Date: Sat, 26 Apr 2008 20:56:44 -0600 Subject: [Rubyosa-discuss] Open URL in Default Browser In-Reply-To: <08D15D50-2128-4902-B670-97AA5556C749@gmail.com> References: <08D15D50-2128-4902-B670-97AA5556C749@gmail.com> Message-ID: <20080427025644.GV30749@hinegardner.org> Or in pure ruby: gem install launchy require 'launchy' Launchy.open("http://google.com/search?q=Ruby") Of course, this doesn't use any of the system events, it uses the 'open' command line application, which does the right thing. enjoy, -jeremy On Sat, Apr 26, 2008 at 10:30:26PM -0400, Jon Baer wrote: > Hmm not sure about RubyOSA but something like this would work w/ RubyCocoa: > > require 'osx/cocoa' > @url = OSX::NSURL.URLWithString("http://google.com/search?q=Ruby") > OSX::NSWorkspace.sharedWorkspace.openURL(@url) > > - Jon > > On Apr 26, 2008, at 9:25 PM, Benny Wong wrote: > >> Hi everyone, >> >> I've been poking around the 'System Events' application using RubyOSA and >> I >> haven't been able to find a way to simply open a URL in the default >> browser, >> ie. how would i do: >> >> tell application "System Events" >> open location "http://google.com/search?q=" & s >> end tell >> >> Has anyone come across this? Any help would be great. Thanks! >> >> Cheers, >> Benny -- ======================================================================== Jeremy Hinegardner jeremy at hinegardner.org