From the forum, for Google, but should work for others (replace search-command and set button as script):
function OnClick(data) {
data.func.command.ClearFiles();
var objEnum = new Enumerator(data.func.sourcetab.selected);
while (!objEnum.atEnd()) {
var item = objEnum.item().name_stem; objEnum.moveNext();
var encoded = encodeURIComponent(item);
var search = encoded.replace(/%/g,"%%");
data.func.command.RunCommand("http://www.google.de/search?q=" + search);
}
}