• 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: Brian Johnson <email@hidden>
  • Date: Sun, 10 Feb 2008 09:41:41 -0800 (PST)


On Sun, 10 Feb 2008, Grace Finn wrote:

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

Grace, you apppear to be using an applescript to control the browser's refresh function? Is that to renew the controller or to update the camera image? If you explain why this is part of the picture, I think we might 'get it' better.


If the camera is delivering a streamed video, I'd suggest using a frameset, placing the camera view in one frame and the robot controller in another. Think of the controller as providing one command at a time. Each time the user clicks a command or hits submit in the controller frame, the browser, as has outlined, sends that info to the server, which passes it to the acgi, which does the thing and returns a new form (or a redirect to a form) to the browser, which updates the display in the controller frame.

As for reloading, you don't really want to use an HTTP or a META-tag refresh (for example) in the controller frame because that will fire even if a visitor is in the process of filling out the form. But you might use a refresh in the "viewer" frame if your camera only delivers stills on command rather than streamed video.

The scenario described here (and by has) uses a browser as a means of seeing and controlling the robot, but the browser is not scripted directly by AS. It may receive JS content from your web site, and you may generate the JS from an AS acgi on the web site, but from the browser's point of view, all it sees is normal web content.

HTH.

 -b.johnson
_______________________________________________
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: A date IS a date
  • Next by Date: do shell script vs. do script with command
  • Previous by thread: Re: PHP and Applescript
  • Next by thread: Re: PHP and Applescript
  • Index(es):
    • Date
    • Thread