Action Directory / Lookup

Install

Shared by dg.account

Script

dictionary = [
	"Amazon|http://www.google.com/search?btnI&q=site:amazon.com+kindle+",
	"Goodreads|http://www.google.com/search?btnI&q=site:goodreads.com+",
	"Library Genesis Fiction|http://libgen.io/foreignfiction/index.php?f_lang=English&f_columns=1&f_ext=All&f_group=1&s=",
	"Library Genesis Nonfiction|http://libgen.io/search.php?&lg_topic=libgen&open=0&view=simple&res=25&phrase=1&column=def&req=",
	"Rotten Tomatoes|http://www.google.com/search?btnI&q=site:rottentomatoes.com+",
	"Seedr|workflow://run-workflow?name=Seedr&input=text&text="
];

ui.list("Lookup", dictionary, false, lookup);

function lookup(selectedValues) {
	if (selectedValues) {
		range = editor.getSelectedLineRange();
		line = editor.getTextInRange(range[0], range[1]);
		app.openURL(selectedValues[0] + encodeURIComponent(line));
	}
}