• 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: CGI Request Query Part II
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CGI Request Query Part II


  • Subject: Re: CGI Request Query Part II
  • From: Brian Johnson <email@hidden>
  • Date: Wed, 7 Nov 2001 09:03:20 -0800 (PST)

On Wed, 7 Nov 2001, Steve Thompson wrote:

> I have just discovered, following my posting of about 10 minutes ago,
> that this doesn't work either
>
> on handle CGI request
> beep
> end handle CGI request
>
> or
>
> on handle CGI request this_request
> tell application "Finder"
> display dialog "Hello"
> end tell
> end handle CGI request
>
> So, it's clear that I don't understand how this handle CGI request
> option works when you don't pass it an argument. The fact that I don't
> get an error message for either of the scripts above implies that the
> syntax is correct and you can do a "on handle CGI request".
>
> So how do I get a CGI with no parameters to execute, query a couple of
> scriptable applications and output the result as HTML? I have a script
> that I thought did that, but http://10.1.0.150/pairerquery.cgi just
> times out although pairerquery.cgi launches on the server (tried
> personal Web sharing on 91 and AppleShare IP 6). Also
> http://10.1.0.150/pairerquery.cgi?p=0 has the same effect.
>
> TIA
>
> Steve

The unadorned "on handle CGI request" should work fine. It won't work with
the OSX Apache server 'cause it doesn't support the appleevents interface
(though it will launch the cgi applet if it's not running).

Perhaps you are not returning a correct response? It's got to include the
header info, along the lines of ...

property OK_header : "HTTP/1.0 200 OK" & CRLF & "Server: WebSharing/1.5.2"
& CRLF & "MIME-Version: 1.0" & CRLF & "Content-type: text/html" & CRLF &
CRLF

and it's got to be returned to the browser. In your examples, if you just
want the script to get your attention and prove it's running, insert an
"activate me" in front of the beep or display dialog.

Finally, I've found PWS a bit flakey with my applescript CGIs. Sometimes
it comes to the conclusion that files are open elsewhere (perhaps the
server's got them open, but not me), etc. Still, I have users who seem
satisfied, so I think it really does work. It's just a matter of working
out a few wrinkes.

HTH.

Brian Johnson, Dept of Architecture, University of Washington, Seattle


References: 
 >CGI Request Query Part II (From: Steve Thompson <email@hidden>)

  • Prev by Date: CGI Request Query Part II
  • Next by Date: set picture boxes with TIFF picture to a variable?
  • Previous by thread: CGI Request Query Part II
  • Next by thread: set picture boxes with TIFF picture to a variable?
  • Index(es):
    • Date
    • Thread