<%*
var now_time = tp.date.now("HH:mm");
var input = await tp.system.prompt(now_time + " - Interstitial Journal");
if (input == null) { return; }
input = "- " + now_time + " - " + input;
var filePath = tp.date.now("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 app.vault.read(file);
const fileContent = ${original_fileContent}\n${input}
;
await app.vault.modify(file, fileContent);
}
%>
Last active
February 13, 2023 13:09
-
-
Save FTWynn/1ce114769381d2aed449739bf21c9d47 to your computer and use it in GitHub Desktop.
Shamelessly stolen from chhoumann/Templater_Templates, but trimmed down to fit the simple case of appending an Interstitial Journal to the Daily Note
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update: better title and handled escaping out of the prompt