The file internet tool in Ubuntu provides the ability to run scripts on a selected file.

Add "Open with gedit" to the right click menu in Ubuntu