My first Ubiquity command : view a case in Dovetail
I was pretty excited to play with Ubiquity, a new Firefox extension that lets me think and act in a more natural language with my PC.
From the Ubiquity Tutorial:
Ubiquity is an experimental Firefox extension that gives you a powerful new way to interact with the Web.
You’re used to telling Firefox where you want to go by typing Web addresses into the URL bar.
With Ubiquity installed, you’ll be able to tell Firefox what you want it to do by typing commands into a new Ubiquity input box.
The commands that come with Ubiquity are just the beginning: anyone can create new commands and share them.
Some of the built-in commands include:
- add-to-calendar
- calculate
- define
- ebay-search
- flickr
- map
- search
- tinyurl
- weather
- zoom
After playing with the build-in commands, I was ready to try and write my own.
Naturally, I wanted to tie this in with our Dovetail suite, so I came up with a simple example: Quickly view a case in Dovetail.
Ubiquity commands are written in JavaScript (and Ubiquity can even use jQuery – which I’m a huge fan of).
Here’s my first Ubiquity command:
CmdUtils.CreateCommand({
name: "case",
takes: {"caseId": noun_arb_text},
icon: "http://www.dovetailsoftware.com/favicon.ico",
author: { name: "Gary Sherman", email: "gary@dovetailsoftware.com"},
description: "Displays a case in the Dovetail system.",preview: function( pblock, input) {
pblock.innerHTML = "Will display the summary for case number: " + input.text;
},execute: function(caseId) {
var url = http://demo.dovetailsoftware.com/mobile/Cases/Summary/ + caseId.text;
Utils.openUrlInBrowser(url);
}
})
To execute a Ubiquity command, type Ctrl-space, then start typing your command. It shows the commands, along with the parameters needed.
For example, if I just type case, here’s what is shown:
If I type case 3:
Click enter, and up pops the web page, showing the case;
Notice here that I’m using the new Dovetail Mobile Agent application. Although its intended purpose is for mobile devices, it works super on full-size browsers as well. If I wasn’t already logged in to the Mobile Agent, it would prompt me to login, and then automatically take me to the requested case page.
Using Selected Text
Ubiquity also knows how to deal with the selected text on a page. So if I have a case Id number shown in a browser window (such as in Campfire), I can simply highlight the case Id number, and type case this, it fills in the selected text, so I don’t even have to type it:
Ubiquity is pretty bad ass. Its just in its infancy, so it will be interesting to see where Mozilla continues to take it, as well as how the community extends the list of available commands.