// Name: File To Support Tags // Description: Wraps dropped file content in <support> tags // Author: tayiorbeii import '@johnlindquist/kit' const droppedFiles = await drop(); if (!droppedFiles || droppedFiles.length === 0) { await div("No files were dropped."); exit(); } let output = ""; for (let i = 0; i < droppedFiles.length; i++) { const file = droppedFiles[i]; try { const fileContent = await readFile(file.path, "utf-8"); output += `<support${i + 1}>${fileContent}</support${i + 1}>\n`; } catch (error) { console.error(`Error reading file ${file.path}:`, error); await div(`Error reading file ${file.path}. Please check the console for details.`); continue; // Skip to the next file } } await setSelectedText(output.trim()); await div(md("Copied to clipboard!"));