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

Many times I don't want to url encode what I have on the clipboard, but I want to manually type it. This little script is for that.

Open url-encode in Script Kit

// Name: url encode
import "@johnlindquist/kit"
const text = await arg("What do you want to encode");
const encoded = encodeURIComponent(text)
await copy(encoded);