bridging php and applescript
February 25th, 2006
While playing around with building a web interface for my deeply closeted media server, I uncovered a nifty how-to that lets you send osascript commands — essentially, AppleScript commands executed on the command line — via php. This allowed me to create a web page which passes AppleScript commands to iTunes which then streams music to my stereo: pretty cool.
The downside? Welp, long story short, to be able to fire off AppleScript commands via php exec statements, you’ve got to run Apache as “you”; normally, Apache runs as an unprivileged user called “www”. Setting up Apache to run as “you” is pretty unsecure, even by my horribly loose definition of secure; there’s got to be a better way to integrate AppleScript and the web…
~jeff
Pingback: codepoetry | Using PHP and a Shell Script to Reboot an AppleTV Remotely — via the web