// Name: XML Tag Insertion
// Description: Inserts an XML tag at the cursor.
// Author: tayiorbeii
import '@johnlindquist/kit'
try {
// Prompt the user for the XML tag name
const tag: string = await arg('Enter XML tag name:')
// Construct the XML tag string
const xmlTag: string = `<${tag}></${tag}>`
// Insert the XML tag into the currently active text input
await setSelectedText(xmlTag)
} catch (error: any) {
console.error('An error occurred:', error)
notify({
title: 'Error Inserting XML Tag',
message: error.message || 'An unexpected error occurred.',
})
}