Script Kit Logo
Script Kit
by John Lindquist
Free TutorialsTipsCommunity ScriptsDocsDiscussBlog
Daniel Rodríguez Rivero
Scripts /

Daniel Rodríguez Rivero

Insert current timestamp as YYYY/MM/DD

by Daniel Rodríguez Rivero
InstallAdd to Kit.app
// Name: today-timestamp
// Description: inserts the today date (not including time) formatted as YYYY/MM/DD
// Snippet: !tday
import '@johnlindquist/kit';
function twoDigits(number: number): string {
return number.toString().padStart(2, '0');
}
await hide();
const today = new Date();
// Format date to YYYY/MM/DD format
const formatted = `${today.getFullYear()}/${twoDigits(today.getMonth() + 1 )}/${twoDigits(today.getDate())}`;
await keyboard.type(formatted);

Ask for user input and transform it to a url encoded string

by Daniel Rodríguez Rivero
InstallAdd to Kit.app
// Name: url encode
import "@johnlindquist/kit"
const text = await arg("What do you want to encode");
const encoded = encodeURIComponent(text)
await copy(encoded);

Copy MacOS version to the clipboard

by Daniel Rodríguez Rivero

// Name: os version
import "@johnlindquist/kit"
const version_info = (await $`sw_vers`).stdout
const version_lines = version_info.split("\n");
const version_number = version_lines[1].replace(/(?:.*?)(\d+)/,"$1");
copy(`macOS ${version_number}`);
created by
John Lindquist
GitHub