How to pass a filename into a Juce app via double click in Finder?


Hi guys

I have an issue with the following:

I'd like to be able to double click an .xml session file in the finder (currently working on OSX but it's for WIndows also) and it launch my Juce application and also pass in its filename so that the Juce app can subsequently load the session file once intialised. Also double-clicking a session data file whilst the app is running should also potentially load the data file.

I can see how to pass in command line args, which works fine, but I can't see a way to retrieve the filename of the launching session file.

Any clues?!

Cheers :)





I don't understand the problem.. Your JUCEApplication::anotherInstanceStarted() method should get called with the command line, and that'll contain the filename, so you just open it and do whatever you need to (?)

Maybe have a look at the Introjucer's version of this?


Got it - thanks Jules!