Created
December 29, 2009 12:50
-
-
Save spejman/265292 to your computer and use it in GitHub Desktop.
Ubiquity 0.5 command for seaching in Spotify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on http://anders.mellbratt.se/lastspot.html Thanks to Anders Mellbratt | |
CmdUtils.CreateCommand({ | |
names: ['spotify search'], | |
arguments: [{role: 'object', nountype: noun_arb_text, label: 'music seach'}], | |
icon: "http://www.spotify.com/favicon.ico", | |
description: "Performs a search in Spotify", | |
author: {name: "Sergio Espeja", email: "[email protected]"}, | |
homepage: "http://sergioespeja.com", | |
preview: function( pblock, args ) { | |
pblock.innerHTML = "Do a spotify search for: <i>" + args.object.text + "</i>"; | |
}, | |
execute: function(args) { | |
Utils.openUrlInBrowser("spotify:search:" + args.object.text); | |
var tabName = args.object.text; | |
var tab = Utils.tabs.get("spotify:search:" + args.object.text); | |
if (tabName && tab) { | |
tab.close(); | |
} | |
else { | |
Application.activeWindow.activeTab.close(); | |
} | |
displayMessage(tabName + " tab closed"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment