I was messing about with applescript and a bit of
PHP, and found that it's possible to use php to call
applescript commands.
The zip file contains a sample page for controlling iTunes, and a readme containing the 4 lines in httpd.conf that need to be changed.
For more complex commands (such as tell blocks) the ocascipt has an argument to accept a file, or to take the commands from standard input.
The example is very simplistic, but right now I'm sat on the other side of the room with that page pulled up on my PDA, and is obviously as extendable as you want it to be.
http://uploads.omega.org.uk/Applescript.zipThe developer documentation for applescript can be found
here if anyone is interested in further developing the sample.