I'm not even sure if this is possible or not but this is what I'm trying to do: Everytime a user opens a file through double clicking I want to launch a script which does a few things depending upon what kinda file it is or what directory it's in. How do I launch a script when the user opens a file?
This is possible to do.
You will need to watch the file system using inotify-tools to check for events (such as files being opened) and then handle them as required (such as running a shell script).
You will need to know about incron too.
There are some examples on the incron site, something like this may be a starting point for you: