Ok - Ive composed a script based on the discussion thread you suggested and saved this script from BBEdit in the executables folder:
#!/bin/sh
# This script illustrates how to put up dialogs via AppleScript
# Note that some of the longer lines have been continued over two lines
# by typing a backslash immediately followed by a Return
# Cameron Hayne (macdev@hayne.net) December 2004
# a dialog with a text message and some buttons
message="Hello World!"
button=`/usr/bin/osascript << EOT
tell application "Terminal"
say "$message"
beep
display dialog "$message" buttons {"Hello", "Goodbye"} \
default button "Hello" giving up after 15
set result to button returned of result
end tell
EOT`
It woks OK from the command line
but
I get the following error when attempting
http://192.168.0.2/cgi-bin/testcgi
The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: testcgi
Im stumped - any suggestions?