Make a clickable link that activates an Applescript

Hi all,

I want to make a link where I can click on in an application like iCal and it runs an spefic Applescript. How do I make it clickable? How to activate that link.

How should it look like to guide to a specific Script on my desktop and is there a way to actually have the applescript in the link?

Best regards - Christoph

If you are talking about when you are in iCal then;
Just drag your script to the ‘URL’ tab in iCal, it will put the correct url for you to the file.

To have it run when you click it you have to click the ‘URL’ tab and select go to location.
And the script has to be saved as an app.

The url will look like this file://localhost/Users/UserName/Scripts/the_time.app/ in iCal

Wrapping the script (not app) using applescript://com.apple.scripteditor?action=new&script="tell a…
does not work as iCal does not recognise the applescript://. And also it would look ungainly.

If you are talking about when you click the iCal app to open, it runs a script on launch then;

Off the top of my head, there are a couple of ways to do this. One way is to use lunchd to watch for ical and run a script.
another is to write a AS to launch say iCal and run your script. save it as a app. and use an alias with the iCal icon.
Do this for each app.