Invoking Applescript from within Javascript

I have done quite a bit of poking around and have not found much information on this subject. Here are my requirements:

  • dynamically generate a tree from XML document that is viewable in standard web browsers
  • have a user-click on a leaf node in the tree launch an Applescript and receive a return value
  • user should not have any interaction aside from clicking an a link (tree node) from their web browser

My current approach is to build the tree using Javascript. I already have developed the Applescripts which drive my application. All I really would like to do is be able to invoke my Applescript from within the Javascript code. Is this possible? Or, if I am approaching this problem naively, is there a better way?
Thanks in advance for the help!

If you wanna it done in the user-side (not in a server, that is, all the process is done in user’s machine):
-I can explain.
-You can search this BBS for “protocol helper” (or similar)
-You can take a look to an already-done project called “fle”, original idea of Peter Bunn and me. It is module-based, so you could adaptate easilly (most probably) your code and get your work done in a few steps. Feel free to browse this:
http://homepage.mac.com/julifos/soft/beta/fle_project.sit
To get started, uncrompress the package, open Safari and type “fle:” (then, enter) in a new window. It should launch “fle” (the app in the package), and “fle” should show you in Safari a HTML page with two links (available “modules”): “ls” and “iTunes”. Choose “ls”. It should show a browse-able list of of files/dirs in your startup disk.
All this is managed by the script “ls” in the “modules” folder.
You will find also in the “docs” folder a “sample module.txt” file, which will teach you briefly how modules should be written to work.
Actually, it does only support Safari, but could be done to support any browser. If you need more details on how “fle” is done (though you can see the source in the “docs” dir), just ask. Or just discard the idea. What you see in “fle” is what can be done without C (or similar) programming. :rolleyes:

does fle work in osx 10.4.8 ?

I followed the instructions and type fle: in safari but nothing happens…

Grant