Skip to content

Instantly share code, notes, and snippets.

@parolkar
Created October 31, 2011 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parolkar/1327018 to your computer and use it in GitHub Desktop.
Save parolkar/1327018 to your computer and use it in GitHub Desktop.
Cute little script to help in making interactive script when STDIN is unavailable
#!/usr/bin/ruby
result = `/usr/bin/osascript <<EOT
tell application "Terminal"
activate
set Input to display dialog "Enter Text:" with title "Hello" with icon 0 default answer "" buttons {"OK"} default button 1
return text returned of Input as string
end tell
EOT
`
puts result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment