Mac Finder file details

I have written a little program for OSX using Juce. When I start it by opening the .app file it displays a file dialogue and then processes the selected file correctly. I want to also be able to start it by opening a file in finder and have the file association start my program on the selected file. I can set an association and have it start my program but it does so without supplying any command line parameters. How does one find out which file was opened in finder?


The finder doesn’t start with the clicked file argument, but rather sends a message to the running Application to open the file.

To make that work, you have to add your file extension to the XCode exporter.
You will notice, that your file icon appears now for that file type, if you set it as default.
To react to the open message, implement your file loading in (or rather call it from) the override of JUCEApplications anotherInstanceStarted (const String& commandLine).

Good luck

1 Like