Skip to main content
Known Participant
May 11, 2014
Question

How to launch an Air desktop app from a second Air desktop app?

  • May 11, 2014
  • 1 reply
  • 225 views

Hi,

Is there a way to launch an Air desktop app from a second Air desktop app?

I'm using Air 4 with Flash CS 6 on Windows.

Thanks

This topic has been closed for replies.

1 reply

May 12, 2014

According to Adobe documentation, AIR doesn't allow you to launch one application using another on desktop. The best bet that I could find at the moment would be to use the File.openWithDefaultAppilcation() function and open a file(like a .doc or .txt file) that has an AIR app set as the default application to use for X filetype. Unfortunately, launching app(.exe, .app, etc) files directly is not allowed. Probably for safety/security reasons. You might be able to get around that with a Native Extension though. Below is a link to the File.openWithDefaultApplication() method which includes a table of all the filetypes not allowed. Tried messing around with some ways around it, but the best I could do was open a new Finder window(testing on a Mac) and highlight the file. The code below assumes that both AIR apps are installed in the same app directory. Not sure how it would work on Windows but the result might be the same. For Mac, no special characters or anything was needed even though the app I was trying to open had spaces in the filename.

var filePath:String = "file://" + File.applicationDirectory.nativePath + "/App to highlight.app";

navigateToURL(new URLRequest(filePath));

File - Adobe ActionScript® 3 (AS3 ) API Reference