rem: var mimeInfoService = Components .classes["@mozilla.org/uriloader/external-helper-app-service;1"] .getService(Components.interfaces.nsIMIMEService); var mimeInfo = mimeInfoService .getFromTypeAndExtension( "application/x-userscript+javascript", "user.js" ); mimeInfo.preferredAction = mimeInfo.useHelperApp mimeInfo.preferredApplicationHandler = editor; mimeInfo.launchWithFile( aFile ); 
add: var process = Components.classes["@mozilla.org/process/util;1"] .getService(Components.interfaces.nsIProcess); process.init(editor); process.run(false, [aFile.path], 1); 
context: function openInEditor(aFile, promptTitle) {  var editor, editorPath;  try {    editorPath = GM_prefRoot.getValue("editor");  } catch(e) {    GM_log( "Failed to get 'editor' value:" + e );    if (GM_prefRoot.exists("editor")) {      GM_log("A value for 'editor' exists, so let's remove it because it's causing problems");      GM_prefRoot.remove("editor");    }    editorPath = false;  }  if (editorPath) {    // check whether the editor path is valid    GM_log("Try editor with path " + editorPath);    editor = Components.classes["@mozilla.org/file/local;1"]        .createInstance(Components.interfaces.nsILocalFile);    editor.followLinks = true;    editor.initWithPath(editorPath);  } else {    var nsIFilePicker = Components.interfaces.nsIFilePicker;    var filePicker = Components.classes["@mozilla.org/filepicker;1"]      .createInstance(nsIFilePicker);    filePicker.init(window, promptTitle, nsIFilePicker.modeOpen);    filePicker.appendFilters(nsIFilePicker.filterApplication);    filePicker.appendFilters(nsIFilePicker.filterAll);    if (filePicker.show() != nsIFilePicker.returnOK) {      return false;    }    editor = filePicker.file;    GM_log("User selected: " + editor.path);    GM_prefRoot.setValue("editor", editor.path);  }  if (editor.exists() && editor.isExecutable()) {    try {      GM_log("launching ...");      var mimeInfoService = Components        .classes["@mozilla.org/uriloader/external-helper-app-service;1"]        .getService(Components.interfaces.nsIMIMEService);      var mimeInfo = mimeInfoService        .getFromTypeAndExtension( "application/x-userscript+javascript", "user.js" );      mimeInfo.preferredAction = mimeInfo.useHelperApp      mimeInfo.preferredApplicationHandler = editor;      mimeInfo.launchWithFile( aFile );      return true;    } catch (e) {      GM_log("Failed to launch editor: " + e, true);    }  } else {    GM_log("Editor '" + editorPath + "' does not exist or isn't executable. " +           "Put it back, check the permissions, or just give up and reset " +           "editor using about:config", true)  }  return false;}
meta: 4236	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/4236/2ecdc571acb18282034e49ad2f91295e0d741751/utils.js/clean/src/chrome/chromeFiles/content/utils.js