The way to do this (I’ve got it working on my Mac) it that you code PHP to create a text file in a folder based on the results of some web action. You also have a stay open AppleScript with an idle routine (like the one above) constantly looking for the new file. The AppleScript could read properties from the contents or the title of the new text document and delete it when it’s finished.
To pass values back to PHP from AppleScript, just do the opposite, have the AppleScript write the values to a text file and have PHP look for that file (set a loop checking for the returned file exiting when it’s there) then read, parse, and delete the file.
So I got pulled off this project and stuck on another… but back into it now.
I’ve taken your workings and added a bit to both the PHP and the Applescript.
Essentially I write a file from PHP that contains the user_name, password, ip_address, and a short message. (The users ip_address gets updated everytime they log in… so if they swap machines or the DHCP server does a client reset it doesn’t matter).
Then I’m just watching for a new file and then reading it in Applescript and setting the variables from the file.
And it works brilliantly for both OS 9 and OS X clients (although the applescript only runs reliably on our OSX server).
Plus users don’t even need to have their browser open… as long as they’ve logged in on the machine they’re sitting at they’ll get the new task message.
Many thanks to everyone and if you’d like the code please feel free to contact me.