Skip to content

Instantly share code, notes, and snippets.

@gattu gattu/x
Created Oct 31, 2008

What would you like to do?
Ubiquity command for opening Notepad application from Firefox (on Windows only)
author: { name: "Aman Bhatia", email: ""},
license: "MPL",
description: _("Opens Notepad. Currently works with Windows only"),
name: ['notepad', 'notes'],
arguments: [],
execute: function(args) {
var process = Components.classes[";1"].createInstance(Components.interfaces.nsIProcess);
var path = "c:\\windows\\notepad.exe";
var args = path.split(" ");
var executable = Components.classes[";1"].createInstance(Components.interfaces.nsILocalFile);
executable.followLinks = true;
if (executable.exists() && executable.isExecutable()) {
args.splice(0,1);, args , args.length);
} else {
displayMessage(args[0] + ' is not an executable');
preview: function(pblock, args) {
s = _("Opens Windows Notepad.") + "<br>";
pblock.innerHTML = CmdUtils.renderTemplate(s);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.