Skip to content

Instantly share code, notes, and snippets.

@pioz
Created December 14, 2011 17:34
Show Gist options
  • Save pioz/1477585 to your computer and use it in GitHub Desktop.
Save pioz/1477585 to your computer and use it in GitHub Desktop.
Inputbox in Ruby using win32ole
require 'win32ole'
def inputbox(message, title = '')
sc = WIN32OLE.new("ScriptControl")
sc.language = "VBScript"
sc.eval("Inputbox(\"#{message}\", \"#{title}\")")
end
def popup(message)
wsh = WIN32OLE.new('WScript.Shell')
wsh.popup(message, 0, __FILE__)
end
res = inputbox('Your input please.', 'Inputbox example')
popup("Your input is #{res}!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment