Problem to launch external application under OSX

Talk about add-ons and extension development.
Post Reply
Sethnakht
Posts: 41
Joined: December 12th, 2004, 1:52 pm
Contact:

Problem to launch external application under OSX

Post by Sethnakht »

Hello,

I had a problem in running process under OSX operating system, the following code :

Code: Select all

try 
{
   // create an nsILocalFile for the executable
   var file = Components.classes["@mozilla.org/file/local;1"]
                               .createInstance(Components.interfaces.nsILocalFile);
   file.initWithPath("/Applications/VLC.app");
   
   // create an nsIProcess
   var process = Components.classes["@mozilla.org/process/util;1"]
                               .createInstance(Components.interfaces.nsIProcess);
   process.init(file);
   var args = ["arg1", "arg2"];
   process.run(false, args, args.length);
}
catch (e)
{
   dump(e);
}


throw the exception :

Code: Select all

[Exceptions... "Component returned failure code:
0x80004005 (NS_ERROR_FAILURE) [nslProcess.init]"
nsresult: "0x80004005 (NS_ERROR_FAILURE)"
...


All the extension tested (Launchy, External_Application_Buttons...) doesn't works :(

Is it a bug or a code error ? Is exist an extension wich launch and external extension and run under OSX ?
(FoxyTunes launch correctly the player but it use a platform based compiled library...)

Thanks for any help !

Sethnakt
asqueella
Posts: 4019
Joined: November 16th, 2003, 3:05 am
Location: Russia, Moscow

Post by asqueella »

There were a few problems with nsIProcess on Mac. See bugs linked from here:
http://www.xulplanet.com/forum/viewtopi ... =1114#1114
Sethnakht
Posts: 41
Joined: December 12th, 2004, 1:52 pm
Contact:

Post by Sethnakht »

Ok,
thanks that the info I was looking ;)
ed_x
Posts: 15
Joined: November 2nd, 2006, 2:04 am
Location: Netherlands

Post by ed_x »

I'm stuck with the same issue, but the URL to xulplanets forum doesn't work anymore. What's the new link, or what did it say?

Thanks

edit:
run "/usr/bin/open"
arguments: ["-a", "/Applications/TextEdit.app", "/home/me/file.txt"]
Post Reply