Open synonym-snippet in Script Kit

// Name: Synonym Snippet
// Snippet: *,,
import "@johnlindquist/kit"
let word = await arg("The value of *")
let response = await get(`https://api.datamuse.com/words?ml=${word}`)
let synonyms = response.data.map(i => i.word)
let synonym = await arg("Select a replacement", synonyms)
await setSelectedText(synonym)