Thanks for your comment but I doubt we're talking about the same thing. Perhaps I misused some of the terminology (as I doubt that making a small script the default application for handling m3u and pls files would result in running at the events mentioned in your post). Maybe a little background helps:
I am experimenting with an MPD-server (Music Player Daemon) and I want it to be able to handle m3u and pls playlist in an easier way. Right now I have to extract the http location manually and add it through terminal with a command like: 'mpc add
http://location/stream'. As you can imagine that spoils the fun quite fast.
Someone thought of an easier way and posted it at:
http://mpd.wikia.com/wiki/Music_Player_Daemon_Browser_Stream_Setup
His solution is a .sh script (posted below) and let Firefox open the .pls files with the .sh script by default. The script works perfect in terminal, so I do not have to extract the http address anymore from the pls file. However, Firefox refuses to handle .sh files.
Therefore I tried whether OSX would accept the .sh file as a default application. It doesn't. I figure that the solution for the OSX problem is similar as that for Firefox, if not the same. Since the OSX community is larger than the OSX and firefox community by definition, I figured this place is a good start.
Of course I could take some time and try to make a small Applescript to do the same job and save it as an application. But since there are quite a few of these .sh script going around, I think it is better to try to find a solution for running the .sh scripts than rewriting them all.
I hope this clarifies some.
Maarten
Here is the .pls version of the script:
#!/usr/bin/env sh
mpc clear
grep '^File[0-9]*' $1 | sed -e 's/^File[0-9]*=//' | mpc add
mpc play