Re: Passing a variable from a webpage to an AppleScript
Re: Passing a variable from a webpage to an AppleScript
- Subject: Re: Passing a variable from a webpage to an AppleScript
- From: JJ <email@hidden>
- Date: Thu, 25 Oct 2001 18:34:42 +0200
>
I am using "SiteCam" for my webserver. It has the ability to run
>
AppleScripts connected to a webpage as I've described above.
>
>
It all boils down to this: I am going to trigger a script by clicking on
>
a link. I want the pass AppleScript the text of what I clicked on. Can I?
I've been asking the same question the last weeks. No answers, but I can say
two things:
If you possess a webserver, the work is so easy: use cgi apps.
i.e.
web page:
<a href="applescript.cgi?cd=25&song=track2>Good Golly, Miss Molly</a>
applescript.cgi
on handle CGI request path_args searching for s_args
-- s_args -> ?cd=25&song=track2
-- parse args
-- tell any app
-- open cd 25, track 2
end handle CGI request
If you don't possess a webserver, then you could look at MacScripter.net for
an applescript called "TelProtocolHandler", by Guido Tonini. Basically, it
explains how configure a new protocol controlled by your own applescript.
(i.e., if you want your machine to open "hotline:" protocol with Hotline
Client, then you must configure your preferences in order to do it). You
should invent a new protocol ("johnny:") controlled by an applescript app,
which will receive the variables from, i.e., a form or simple link.
JJ