Script Kit Logo
Script Kit
by John Lindquist
Browse ScriptsBlogDiscuss
Brandon Pittman
Scripts /

Brandon Pittman

quick-google-translate

by Brandon Pittman

// Menu: JA → EN
// Description: Translate selected text into with Google Translate.
// Author: Brandon Pittman
// Shortcut: ctrl j
import "@johnlindquist/kit";
const origin = "https://translate.google.com";
const text = await getSelectedText();
const sl = "ja";
const tl = "en";
const op = "translate";
const url = encodeURI(`${origin}/?sl=${sl}&tl=${tl}&text=${text}&op=${op}`);
exec(`open "${url}"`, { encoding: "utf8" });
created by
John Lindquist
GitHub