We are building an application where we want to pass arguments on the command line to our application or invoke the application multiple times using the application protocol handler.

For this example, I have an upload application called myUpload. Using the command line we can initiate an upload by executing the following on OSX. The myUpload application will launch and start the upload.

Code:
show myUpload.app --args /Users/me/file_i_want_to_upload
The args can be captured using

Code:
var str = Ion.app.arguments.map(function(arg) { return '"' + arg + '"'; }).join(' ');
If I try to upload a second file (at the same time or prior to the first one finishing), how can capture that event. Since the application is already started i can't use Ion.app.arguments.map. I can imagine a number of other scenarios where this capability would be very useful.

What would be the best approach to capture passed argument when the application is invoked a 2nd time in a cross platform way?