Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

test-cgi

Hi

I'm really stuck.

Has anybody suggestions where I can find a working example(s) of how to call an AppleScript command eg "Launch" from a cgi script, and what HTML to use to pass a variable to the AppleScript?

Thanks, in hope rather than expectation....

Power Mac G5, Mac OS X (10.5.8)

Posted on Sep 2, 2009 2:29 PM

Reply
5 replies

Sep 8, 2009 10:31 AM in response to baltwo

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?

test-cgi

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.