Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%*
- const logHeader = "## To Do"
- const file = tp.file.find_tfile(tp.date.now("YYYY-MM-DD"))
- if (file) {
- loggedItem = await tp.system.prompt("ToDo")
- const content = (await app.vault.read(file)).split("\n")
- const index = content.indexOf(logHeader)
- let addContent = "- [ ] #todo " + loggedItem
- content.splice(index + 1, 0 , addContent)
- await app.vault.modify(file, content.join("\n"))
- } else {
- new Notice("No daily note found.")
- }
- -%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement