MozillaZine


Problem to launch external application under OSX

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

Post Posted April 5th, 2005, 10:58 am

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 Posted April 5th, 2005, 11:28 am

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

Post Posted April 5th, 2005, 12:05 pm

Ok,
thanks that the info I was looking ;)

ed_x
 
Posts: 15
Joined: November 2nd, 2006, 2:04 am
Location: Netherlands

Post Posted November 22nd, 2006, 8:18 am

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"]

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 0 guests