tags:

views:

271

answers:

1

I would like to open OSX windows (and Windows windows) from a ruby script. If I do

system "touch /Users/apple/Documents/thekbase-temp-files/test5.txt"

it works (creates an empty file), but this

system "mate /Users/apple/Documents/thekbase-temp-files/test5.txt"

does not open TextMate, even though it does if I type it. I feel this might be a version of this question but I just want to be sure.

Thanks!

+3  A: 

Try

system "open -a textmate /Users/apple/Documents/thekbase-temp-files/test5.txt"
Chas. Owens
Awesome. Now I'll improvise with cmd on my VirtualBox (Win XP) and if I get it running, I'll check the check mark. Thank you for responding!
Yar
Great. There it was system "cmd /c \\test5.txt" and I'm ready to rock. Thanks again, Chas.
Yar
On Windows, "cmd /c start some_file" is the equivalent to "open some_file" on OSX -- allowing the OS to launch the app with its default application.
glenn jackman