From: hengist podd Date: 2007-07-10T23:23:22+09:00 Subject: Re: Quicktime and Ruby Ari Brown wrote: > Hey, thanks for your help. I just have a quick question. > What does the 'MacTypes::Alias.path(infile))[0]' do? >> movie = QTP.open(MacTypes::Alias.path(infile))[0] > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > I don't understand what the Alias MacTypes::Alias.path(...) creates a new Alias object. The MacTypes module is discussed in more detail in the appscript documentation. > and the [0] are doing. QTP's 'open' command returns an array of references to the newly opened movies, in this case [app('QuickTime Player').movies['some file']]. However, we just want the first item in that array so we call its #[] method. HTH has p.s. The equivalent line in AppleScript would read: set theMovie to item 1 of (open alias "HD:path:to:your file.mp3") except that AppleScript uses an HFS path string rather than a POSIX one for legacy reasons. -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org -- Posted via http://www.ruby-forum.com/.