Web applescript run starter

I have made a tastefully designed web page. I want the links on the web page to trigger the run of the Applescript “applets” I have built. I don’t want to see the applescript editor program.

Is this possible?

Also the web page needs to revert to being the front window after the applescript has run.

You need to set up your script as an application bundle, then make a modification to it’s info.plist. This will set your application as a protocol helper, and can be launched from any internet application. For example, you could set your url identifier as “gorp”, and then execute your app from a browser using “gorp:” instead of “http:”. Here are a few threads that should get you started…
http://bbs.applescript.net/viewtopic.php?id=15421
http://bbs.applescript.net/viewtopic.php?id=8675

As for the refocusing of the web page, you could go various routes. By default, after your app quits it should return focus back to the last application that ran before it. If you’re using the finder or some other app in your application, it will likely steal focus from the browser when your app quits. If you know exactly what application you’ll be browsing from, you can send an ‘activate’ command to it to bring it back to the front before quitting your app. You might also be able to make your app a background application (search for “LSUIElement”) so focus never leaves the browser… assuming that’s appropriate for your application.

You’ll have to be more forthcoming with the details of how your app is set up and what it does if that’s not enough direction for you.

j

Using some other logic I found in the forums, I managed to achieve the same effect using ‘folder actions’.

The web page is linked to an item in a folder. That folder has an action to run an applet residing within the folder. When the applet closes it returns control to the folder. So your tip to close the folder and return to the active Safari browser should be the way ahead. I will look at the links you suggested now.

Many thanks