How can I run a shell script that prompts for user input from within Applescript
AppleScript embedded in a shell script is often messy, hard to read, and hard to quote properly.

I get around that by using this sort of construct.

#!/usr/bin/env bash

read -r -d '' applescriptCode &lt;&lt;'EOF'
   set dialogText to text returned of (display dialog "Query?" default answer "")
   return dialogText
EOF

dialogText=$(osascript -e "$applescriptCode");

echo $dialogText;


-ccs