I have written a command line c program. How do I get it to run when I double click a file
I am using iMac with Yosemite.
I have written a command line program in C++ which plays special midi files. I want to open a terminal, load the program and play the special midi file when the special file is double clicked. The files are distinguished by extensions like .m50 or .mes which are not normally used by standard programs.
When I double click a file in finder which it does not recognise it asks me to select a program which can process the file. When I try to tell it to use my program it will not recognise it and will not accept my instructions.
The program is fully functional and plays the special files from the command line.
I have been using this technique in Windows for years but it appears to not work properly on an iMac.
Please tell me how to make it work.
iMac, OS X Yosemite (10.10.4)