Devo is officially dead. Use Ubiquity.
Before reading this article, please read the introduction to get a better understanding of Devo.
Every action in Devo consists of the following (illustrated below as well):
- Keywords are what the user types to perform your action. It can be anything but it must not have spaces in them. The preferred separator is a dot “.”
- Parameter are basically just descriptors that tell the user what he/she is expected to type after the keyword. For some actions, you can choose to leave parameters empty. This parameter will be passed to your code in the variable “devo_param”.
- Description describes what the action does.
- Code is the Javascript that is run when your action is performed
Let’s write a very simple action that finds a particular stock on Google Finance. Devo “add.actions” and fill up the form as we go on. We’ll call our action “stock.quote” and “stock” will be the user parameter.
After adding add a simple description, we can start writing the code. When you do a search for Apple on Google Finance, notice that the URL for the stock quote is http://finance.google.com/finance?q=Apple . Hence, our code should just be:
//devo_newTab() is a helper function used to open new tabs from Devo.
//devo_param is the variable that contains the user input parameters
devo_newTab(“http://finance.google.com/finance?q=” + devo_param)
After saving this action, you should be able to immediately use it. Open up Devo and type away.
As we have seen, it’s exceeding easy to write search commands. For any website that you want to search, you just need to get the search URL, replace the keywords with devo_param variable and fill up the form.
Of course, Devo can do more than just search webpages. You can practically do anything you want with Devo. For example, you can write actions to control other Firefox extensions. The great thing about these extensions is that you can look at their source doe. So, if you wanted to go to the next song in iTunes using FoxyTunes, just create an action with this code:
foxytunesDispatchPlayerCommand(‘Next’, true);
Or, you can write actions that control Firefox like close all tabs containing a word (thanks to FUEL),
Application.activeWindow.tabs.forEach(function(tab){
if ( tab.uri.spec.toLowerCase().match(devo_param.toLowerCase()) )
tab.close();
});
If you want to look at more example code, you can click the “View Sample Code” on top of the Add Action page. Have fun writing Devo actions!
Comments are closed here. Comment on the blogpost instead.





1 Comment
July 23, 2008 at 7:00 am
[...] I found another program called Devo that solves this problem. Well, sort of… I’ll get to that later. It’s a Firefox extension that gives you basically the exact same UI (you press Shift+x or set the trigger command to whatever you want it to be instead of it always being Shift+Space) and allows you to search google, yahoo, flickr, wikipedia along with several other sites. There are also a few other cool features like annotating a site through SharedCopy. Those are all cool, but what I think really makes this stand out is that it allows you to create your own commands. [...]
Comments are closed.