Here's the script I use. I tried PhotoCapture but found it kind of buggy,
so I decided to use QuickPICT and AutoType instead. In this example the
script is a text file called "davecam.as" and sits in the home directory of
MacHTTP. The URL they would use is http://myhost/davecam.
property crlf : (ASCII character 13) & (ASCII character 10)
property http_10_header : "HTTP/1.0 200 OK" & crlf & "Server: MacHTTP" & ¬
crlf & ¬ "MIME-Version: 1.0" & crlf & "Content-type: text/html" & ¬
crlf & crlf
--tell application "PhotoCapture"
-- activate
-- Capture to Clipboard
--end tell
tell application "QuickPICT"
activate
AutoType "t" holding "command"
end tell
tell application "clip2gif"
activate
convert saving as GIF in a reference to file "Mac:MacHTTP:temp.gif"
end tell
set theText to http_10_header & ¬
"<html><head></head><body>" & ¬
"<center><blink><h1>DaveCam</h1></blink>" & ¬
"<img src=\"/temp.gif\"><p>" & (current date) & ¬
"<br>Click \"Reload\" on your browser to take another picture." & ¬
"</body></html>"
return theText
Unfortunately, the only way I've found to display a new image is to click
"reload" from the browser. If I used a link in the html for the person to
click to take a new picture, the old image keeps coming up in Netscape
(even though a new image is generated). This must have something to do with
it not checking the "last modified" date of the GIF and posting the old
image from cache. The reload button fixes this, but ideally there should be
a way for it to work from a link.
Any suggestions on how to fix this so the browser doesn't reload the old
image (besides giving the GIF a new unique name each time which I don't
want to do.).
What can I do to force Netscape to load the new image from a link?
-Dave
daver@netcom.com