Skip to content

Instantly share code, notes, and snippets.

@unforswearing
Last active November 5, 2016 16:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unforswearing/6db06eeff304a4e96d87 to your computer and use it in GitHub Desktop.
Save unforswearing/6db06eeff304a4e96d87 to your computer and use it in GitHub Desktop.
passing osascript variables to shell scripts
# documenting because it took a while to figure out
function dialogbox () {
osascript <<EOT
tell application "Finder"
activate
set nameentry to text returned of (display dialog "Hello, what is your name?" default answer "")
end tell
EOT
}
yourname=$(dialogbox)
echo "the name that was entered was "$yourname""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment