Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Shamelessly stolen from chhoumann/Templater_Templates, but trimmed down to fit the simple case of appending an Interstitial Journal to the Daily Note

<%* var now_time ="HH:mm"); var input = await tp.system.prompt(now_time + " - Interstitial Journal"); if (input == null) { return; } input = "- " + now_time + " - " + input; var filePath ="YYYY-MM-DD") + ".md"; console.log(filePath); if (await app.vault.adapter.exists(filePath)) { const file = await app.vault.getAbstractFileByPath(filePath); console.log(file); let original_fileContent = await; const fileContent = ${original_fileContent}\n${input}; await app.vault.modify(file, fileContent); } %>

Copy link

FTWynn commented Jun 15, 2021

Update: better title and handled escaping out of the prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment