So I’ve been playing with ubiquity some more. Because all of the code runs in chrome:// space in firefox, you get to run as a first class citizen on the computer. Unfortunately this means if you want to do anything fun you need to deal with XPCOM.
Tonight I stole some code from developer.mozilla.org and came up with the following (only works/tested on a Mac):
function system(cmd, args) {
var file = Components.classes["@mozilla.org/file/local;1"]
file.initWithPath(cmd);
var process = Components.classes["@mozilla.org/process/util;1"]
process.init(file);
process.run(false, args, args.length);
}
CmdUtils.CreateCommand({
name: "say",
takes: {"your shout": noun_arb_text},
preview: function( pblock, theShout ) {
pblock.innerHTML = "Will echo: " + theShout.text;
},
execute: function( theShout ) {
system('/usr/bin/say', [theShout.text]);
},
})
This will run text-to-speech on whatever test you input (either via typing or that is selected in the browser) by using the say command on OSX. The important part though is not what it does, it is what it can do. This opens up all of CPAN to Ubiquity.
I think I’m gonna have some fun now.
Ubiquitous Ubiquity (Score:1)
Rock on! Thanks :)
Now the last thing to do is make it so I can highlight text outside of firefox and use ubiquity on it. In the mac world I suppose you'd say I need to allow silverlight to talk to firefox... but I'm not in the mac world.
Let's see.... there is that telnet-into-firefox thingie to start with. Probably a lot of other ways to do this too. hmm...
Re: (Score:1)
In the Mac world I'd just say use QuickSilver ;)
Re: (Score:1)
What a horrid mis-speak! s/Silverlight/QuickSilver/ of course. ick!