Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
CmdUtils.CreateCommand({
author: { name: "Aman", email: "amanatiitATgmail.com"},
license: "GPL",
description: _("Opens MS Paint. Currently works with Windows only"),
name: ['paint'],
arguments: [],
execute: function(args) {
var process = Components.classes["@mozilla.org/process/util;1"].createInstance(Components.interfaces.nsIProcess);
var path = "c:\\windows\\system32\\mspaint.exe";
var args = path.split(" ");
var executable = Components.classes["@mozilla.org/file/local;1"].createInstance(Components.interfaces.nsILocalFile);
executable.followLinks = true;
executable.initWithPath(path);
if (executable.exists() && executable.isExecutable()) {
process.init(executable);
args.splice(0,1);
process.run(false, args , args.length);
} else {
displayMessage(args[0] + ' is not an executable');
}
},
preview: function(pblock, args) {
s = _("Opens Windows MS Paint.") + "<br>";
pblock.innerHTML = CmdUtils.renderTemplate(s);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.