Script Kit Logo
Script Kit
by John Lindquist
Browse ScriptsBlogDiscuss
Jacob Cofman
Scripts /

Jacob Cofman

JCofman

translate-text-using-deepl

by Jacob Cofman
InstallAdd to Kit.app
// Name: DeepL
// Author: Jacob Cofman
// Twitter: @jcofman
// Description: Translates text using https://www.deepl.com/translator
import "@johnlindquist/kit"
let DEEPL_AUTH_KEY = await env("DEEPL_AUTH_KEY", {
hint: md(
`Get a [DeepL API Key](https://www.deepl.com/docs-api/accessing-the-api/)`
),
ignoreBlur: true,
secret: true,
})
let text = await getSelectedText();
let targetLanguage = await arg("Select a traget Language e.g: DE or EN")
let response = await post(
`https://api-free.deepl.com/v2/translate?auth_key=${DEEPL_AUTH_KEY}&text=${text}&target_lang=${targetLanguage}`
)
setSelectedText(response.data.translations[0].text)

generate-fake-data-with-fakerjs

by Jacob Cofman

// Menu: Fake
// Description: generate fake data with faker.js
// Author: Jacob Cofman
// Twitter: @jcofman
import "@johnlindquist/kit"
const {faker} = await npm("@faker-js/faker");
function getMethodFakerData(method) {
return Object.keys(faker[method]);
}
const fakerMethods = [
"name",
"address",
"phone",
"internet",
"company",
"image",
"lorem",
"helpers",
"date",
"random",
"finance",
"hacker",
"system",
"commerce",
"database",
"animal",
"git",
"music",
"datatype",
];
const method = await arg("Select-Base-Method:", fakerMethods);
const fakerBaseMethods = getMethodFakerData(method);
const script = await arg("Select-Script:", fakerBaseMethods);
const result = await faker[method][script]();
copy(result);
await arg(result);
created by
John Lindquist
GitHub