You wrote a function to open some specific files and you want to be able to always open that file with your application. In this example, we want to open micromed TRC files with wonambi.
Create a desktop entry for your application if you don't have one already.
The file should be in ~/.local/share/applications/ and call the file userapp-wonambi.desktop: