Re: CGIs with OSX
Re: CGIs with OSX
- Subject: Re: CGIs with OSX
- From: T&B <email@hidden>
- Date: Sun, 1 Apr 2001 02:18:47 +1000
You can't just place an AppleScript script into the CGI-Executables
folder to make Apache talk to it. Apache (the web server software) sends
the form data to a unix shell script and doesn't know what to do with an
AppleScript binary file.
What you need is a unix shell scrip in the CGI folder that passes the
form data to your AppleScript script.
I tried this approach:
1. Created a shell script that looks like this:
#!/bin/sh
read postedFormData
/usr/bin/osascript 'tell app "My AppleScript CGI Applet" to handle CGI
request with posted data ' $postedFormData | echo
2. Set the appropriate permissions on the shell script and placed it in
the CGI Executables folder.
3. Resaved "My AppleScript CGI Applet" as a Mac OS X applet and launched
it.
But, when I tested it (by clicking submit on the web form), it didn't
work. I think it's a permission problem with the web server (www) not
having access to osascript etc. But the idea seems sound.
Tom
T&B
http://www.tandb.com.au/appelscript/