• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: CGIs with OSX
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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/


  • Next by Date: is it possible to load a script library with a creation handler
  • Next by thread: Re: CGIs with OSX
  • Index(es):
    • Date
    • Thread