• 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: PHP and Applescript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PHP and Applescript


  • Subject: Re: PHP and Applescript
  • From: has <email@hidden>
  • Date: Sun, 10 Feb 2008 17:15:26 +0000


On 10 Feb 2008, at 16:32, Grace Finn wrote:

I don't understand either. Why should Windows users be looking for the acgi file, which sits behind the scenes on your web server?
Sorry, two different approaches. The first approach I tried used the ACGI dispatcher. I had added a web page refresh to the applescript so it would not continue to try to "open" the acgi as if it were a web page.
tell application "Safari"
do JavaScript "window.location.reload()" in front document
delay 0
end tell


tell application "Robot Controller"
    tell the first robot
        delay 3
        tell outputs "AC"
            set direction to Forwards
            set activity to SwitchOn
            delay 1
            set activity to SwitchOff
        end tell
    end tell
end tell

The link on the web page was a link to the acgi file.

I get the impression that you're a bit confused as to how CGI in general, and ACGI in particular, actually works. Your webpage shouldn't link directly to the ACGI script; it should submit a POST request from a web form to the web server (in this case, Apache + ACGI Dispatcher) which then calls the ACGI script's 'handle CGI request' handler, passing it the form data to process and returning its result as a new web page when done.


As a rough guide, think of the web form as being equivalent to an AppleScript, and the web server combined with your CGI script as being equivalent to a scriptable application.

I'd suggest starting with an existing demo script (IIRC, ACGI Dispatcher comes with some), setting it up according to the provided documentation and studying how it works before you try to write your own. It's much easier to understand how [A]CGI works once you've seen it in action.

HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: PHP and Applescript
      • From: Grace Finn <email@hidden>
References: 
 >Re: PHP and Applescript (From: "Gary (Lists)" <email@hidden>)
 >Re: PHP and Applescript (From: Grace Finn <email@hidden>)
 >Re: PHP and Applescript (From: Brian Johnson <email@hidden>)
 >Re: PHP and Applescript (From: has <email@hidden>)
 >Re: PHP and Applescript (From: Grace Finn <email@hidden>)

  • Prev by Date: Re: terminology conflicts, etc. [was: Re: A date IS a date]
  • Next by Date: Re: A date IS a date
  • Previous by thread: Re: PHP and Applescript
  • Next by thread: Re: PHP and Applescript
  • Index(es):
    • Date
    • Thread