From: pere.noel@... (=?ISO-8859-1?Q?Une_b=E9vue?=) Date: 2006-09-08T02:50:24+09:00 Subject: Re: Ruby OSA "AppleScript" for the Macintosh Phrogz wrote: > I'm sure I'll never finish it, but the point of this post is to find > out if anyone smarter than me knows about Ruby and OSA, and knows what > it would take to at least START a Ruby OSA. that's easy : --- truc.rb ------------------------------------------------------------ #!/usr/bin/env ruby require 'osx/aeosa' as="tell application \"Finder\" activate set my_folder to version choose folder set my_folder to POSIX path of my_folder end tell my_folder" puts OSX.do_osascript(as).to_rbobj ------------------------------------------------------------------------ provided you have installed RubyAEOSA. other solution if you don't want to install RubyAEOSA. u'll have to files one "choose_folder.applescript" call by the other "run_applescript.rb" : --- choose_folder.applescript ------------------------------------------ tell application "Finder" activate set my_folder to version choose folder set my_folder to POSIX path of my_folder end tell my_folder ------------------------------------------------------------------------ --- run_applescript.rb ------------------------------------------------- #!/usr/bin/env ruby puts r=`osascript choose_folder.applescript`.chomp ------------------------------------------------------------------------ -- une b�vue