I haven't tested this, but this wiki page (link) has some suggestions that may help.
See the "Adding your custom URL scheme" section.
Thank you Hansaplast
I changed the code to work for file associations double click
Instead of ...kInternetEventClass, kAEGetURL);
for files should be kCoreEventClass, kAEOpenDocuments);
And receive the event with proper file name.
What I don't know is how long should I wait for this event.
I don't want to slow down the start of the application too much, just because some event could possibly be triggered.
For me it will be better if I can check directly if there is file double clicked instead of waiting