simple way to duplicate vba's InputBox, Msgbox?

P

Phil

I've always used VBScript to write the simple scripts I
occasionally need. But now that I've learned a tiny bit of
ruby, I don't want to use vbscript anymore!

Unfortunately for me, ruby has nothing like InputBox() and Msgbox().
While I'm comfortable with the command prompt and often prefer
it, sometimes its just more convenient to run scripts directly
from windows.

As I'll probably never need any more "GUI capabilities" than
those two statements provide, it seems like fxruby, ruby tk,
etc. is overkill for my simple needs.

I did run across "Ruby & Excel: The InputBox Hack" but of
course it's slow and at least for me, the prompt is not
"active" (you have to Alt-tab to get to it)

Any comments or suggestions would be appreciated.
 
E

Einar Magnús Boson

www.shoooes.net
You can get a simple window with inputbox like this:


Shoes.app :width => 220, :height => 100 do

para "Type some text:"

edit_line:)width => 200).change { |el|
alert el.text
}

end




I've always used VBScript to write the simple scripts I
occasionally need. But now that I've learned a tiny bit of
ruby, I don't want to use vbscript anymore!

Unfortunately for me, ruby has nothing like InputBox() and Msgbox().
While I'm comfortable with the command prompt and often prefer
it, sometimes its just more convenient to run scripts directly
from windows.

As I'll probably never need any more "GUI capabilities" than
those two statements provide, it seems like fxruby, ruby tk,
etc. is overkill for my simple needs.

I did run across "Ruby & Excel: The InputBox Hack" but of
course it's slow and at least for me, the prompt is not
"active" (you have to Alt-tab to get to it)

Any comments or suggestions would be appreciated.

einarmagnus
 
M

Mark Thomas

I've always used VBScript to write the simple scripts I
occasionally need. But now that I've learned a tiny bit of
ruby, I don't want to use vbscript anymore!

Unfortunately for me, ruby has nothing like InputBox() and Msgbox().

Shoes (http://shoooes.net/) is a simple GUI toolkit and probably what
you're looking for. Sample:

if confirm("Do Something?")
do_it
else
do_something_else
end

-- Mark.
 
R

Reid Thompson

Phil said:
I've always used VBScript to write the simple scripts I
occasionally need. But now that I've learned a tiny bit of
ruby, I don't want to use vbscript anymore!

Unfortunately for me, ruby has nothing like InputBox() and Msgbox().
While I'm comfortable with the command prompt and often prefer
it, sometimes its just more convenient to run scripts directly
from windows.

As I'll probably never need any more "GUI capabilities" than
those two statements provide, it seems like fxruby, ruby tk,
etc. is overkill for my simple needs.

I did run across "Ruby & Excel: The InputBox Hack" but of
course it's slow and at least for me, the prompt is not
"active" (you have to Alt-tab to get to it)

Any comments or suggestions would be appreciated.
http://rdialog.rubyforge.org/
 
R

Reid Thompson

Phil said:
I've always used VBScript to write the simple scripts I
occasionally need. But now that I've learned a tiny bit of
ruby, I don't want to use vbscript anymore!

Unfortunately for me, ruby has nothing like InputBox() and Msgbox().
While I'm comfortable with the command prompt and often prefer
it, sometimes its just more convenient to run scripts directly
from windows.

As I'll probably never need any more "GUI capabilities" than
those two statements provide, it seems like fxruby, ruby tk,
etc. is overkill for my simple needs.

I did run across "Ruby & Excel: The InputBox Hack" but of
course it's slow and at least for me, the prompt is not
"active" (you have to Alt-tab to get to it)

Any comments or suggestions would be appreciated.
http://code.google.com/p/zerenity/
 
P

Phil

I now have a simple message_box "function"

Shoes looks very interesting, and so easy...
(at least to get a few trivial scripts working)

And i look forward to checking out zerenity and rdialog.

-- thanks to all!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top