Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%*
- const ideaHeader = "## Ideas"
- const file = tp.file.find_tfile(tp.date.now("YYYY-MM-DD"))
- console.log('file: ' + file.name)
- var loggedItem = "";
- if (file) {
- loggedItem = await tp.system.prompt("Idea to daily note:","",false)
- if (loggedItem !== null && loggedItem !== '') {
- const content = (await app.vault.read(file)).split("\n")
- const index = content.indexOf(ideaHeader)
- let addContent = "idea:: " + 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