Adobe AIR – Issues with Command Line Arguments

After working on a little automation tool for video encoding process we ran into an interesting issue with AIR applications and command line arguments. Here is the scenario:

  1. Encoding process ends.
  2. The encoding process passes a file path to the waiting AIR application via command line.
  3. If the AIR app is not running, it starts up.
  4. The AIR application then checks some data in a database updates some tracking info and possibly grabs the duration out of the file.
  5. The AIR app waits for some more input.

Here is the issue – when the application starts up via the command line call, subsequent calls fail to the AIR application. Our solution, the AIR app has to be running when the OS starts up – that way the initial command line call to start the application doesn’t hold the process.

The command line looks something like in Windows:

C:/Program Files/ServerApplication/ServerApplication.exe "D:/my/storagedir/vidfile.f4v"

The command line looks something like on a Mac:

/Applications/ServerApplication.app/Contents/MacOS/ServerApplication "D:/my/storagedir/vidfile.f4v"

There has to be some way to start the application via the command line without holding everything up right? What am I missing?

Here is what I’m missing:
The new command line looks something like in Windows (added the /b option):

C:/Program Files/ServerApplication/ServerApplication.exe /b "D:/my/storagedir/vidfile.f4v"

The new command line looks something like on a Mac (added the ‘&’ at the end):

/Applications/ServerApplication.app/Contents/MacOS/ServerApplication "D:/my/storagedir/vidfile.f4v" &

Now our little automation AIR tool doesn’t need to be running when the first call happens – it will actually start up – and it can stay open and successfully receive new command line arguments.

About John Crosby

A former professional foodie turned keyboard-jockey in favor of a keyboard, cushy chair and cooler working conditions. I now work at Realeyes Media. I am a Partner and Senior Developer and the office Kuroko: In kabuki, the kuroko serve many of the same purposes as running crew. They move scenery and props on stage, aiding in scene changes and costume changes. They will also often play the role of animals, will-o-the-wisps, or other roles which are played not by an actor in full costume, but by holding a prop. Kuroko wear all black, head to toe, in order to imply that they are invisible and not part of the action onstage.
This entry was posted in actionscript and tagged , , . Bookmark the permalink.

Leave a Reply