<%* const filePath = “C:/dev/g-tools/kb-tools-v2/folder_list.txt”;
const file = tp.file.find_tfile(filePath); if (!file) { new Notice(“File not found!”); return; } const content = await this.app.vault.read(file); const lines = content.split(‘\n’).filter(line ⇒ line.trim() !== ”);
// 3. Get all notes in the vault for efficient checking const allNotes = this.app.vault.getMarkdownFiles().map(f ⇒ f.basename); const noteSet = new Set(allNotes);
// 4. Check each line against existing notes const results = lines.map(line ⇒ { const noteExists = noteSet.has(line.trim()); return { line: line.trim(), exists: noteExists }; });
// 5. Display the results
let output = ## Note Check Results for ${filePath}\n\n;
results.forEach(result ⇒ {
output += - **${result.line}**: ${result.exists ? '✅ Exists' : '❌ Does not exist'}\n;
});
// You can either display the results in a new note or as a notice. // To display in a new note, simply let the script finish. // To display as a notice (for shorter lists): // new Notice(output);
// This will replace the template execution with the output. tR += output; %>