Launching Standalone app by dbl-clicking a document – how can app get file name?

Now, on my computer’s desktop, say I have a MIDI file, and (on a Mac, anyways) I "Get Info" on that file, and set the "Open with:" field to my Standalone app.

Now, when I double-click the MIDI file, my Standalone app launches…good so far. HOWEVER, how do I get the Max patch to grab the filename of the file that launched the app?

If I could get the filename, then I could have some Max object inside the Standalone open that file, or do something meaningful with it on launch. Otherwise, you’re kind of breaking the user’s expectations of document/application interaction.