From: "Rashmi Ranjan p." Date: 2011-08-25T14:18:31+09:00 Subject: Re: Can I write text to a notepad and save the file through Drew Olson wrote in post #648910: > Anukul Singhal wrote: >> Hi, >> >> After invoking notepad through ruby, I wanted to know if I could type >> some text in that notepad (which was just invoked using `notepad`) and >> save it using a ruby code. >> >> Can anyone please help me with the ruby code in this regard? >> >> Thanks, >> Anukul > > Do you really need to invoke notepad? Why not just write the text to the > file directly? > > File.open('foo.txt','w') do |out| > out << 'some text to write to the file, blah blah blah' > end Here, after creating the files, you can launch/open this file by using the below command system('start foo.txt') Hope it helps Thanks RRP -- Posted via http://www.ruby-forum.com/.