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: email@hidden
- Date: Thu, 25 Oct 2001 12:49:58 EDT
Christian,
My first thought is "you need to use a CGI!" But you say that you can already
trigger Applescript's via web page links. How? You must have some other
software installed to allow this. It's not standard behavior and it is a
theoretical security risk.
The standard way to achieve what you want is thru a web page form, maybe with
a popup of the songs, and with a submit button, and an Applescript CGI on the
server side. Check out
http://www.linkedresources.com/teach/applescript/writingCGIs.shtml
to see if that answers your question. For me, I'm intensely curious how you
are triggering the Applescript. Unfortunately, I can't see the guts of those
links since AOL interprets the html. Maybe you can resend them wrapped in xmp
tags?
Jeff Baumann
email@hidden
www.linkedresources.com
In a message dated 10/24/01 6:00:02 PM, Christian Boyce wrote:
>
I have a web-based interface for controlling my stereo and CD changer. I
>
display the currently-playing song and also the list of songs that is "on
>
deck." Naturally the list changes all the time-- the "on deck" song moves
>
to the top of the list, and everything moves up one notch every five
>
minutes or so.
>
>
I want to turn the list of songs that are "on deck" into a list of
>
clickable links. I have a program, TitleTrack Jukebox, that is scriptable
>
and indeed I can write a script like this:
>
>
tell application "2.0TitleTrack Jukebox" of machine "iMac"
>
Add to Playlist by Name "title_of_song" type class "track"
>
-- (title_of_song has to be known!)
>
Next
>
end tell
>
>
I know how to trigger an AppleScript by clicking a link. That part is
>
done. What I can't figure out is how do I get the value of
>
"title_of_song" into my script.
>
>
My HTML will look something like this:
>
>
Mary Don't You Weep
>
The House That Jack Built
>
How I Got Over
>
>
I want my script (playthissong) to know which song title I clicked on. If
>
I can do that I'm home free.
>
>
Naturally, when "Mary Don't You Weep" is done playing, the song at the
>
top of the list will be "The House That Jack Built" so things don't stay
>
put positionally. And, they list of songs is very dynamic-- there is no
>
practical way to write, say, a script for every song in the CD changer.
>
There must be 3000 songs!
>
>
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?
>
>
>
--
>
Christian Boyce
>
http://www.christianboyce.com
>
Home of the famous "BoyceCams"