<%* const title = await tp.system.prompt("Enter title"); if (!title) { return; } const inbox = "Inbox/Inbox.md"; const inboxFile = this.app.vault.getAbstractFileByPath(inbox); const inboxContent = await this.app.vault.read(inboxFile); const nextNo = String(Number(inboxContent) + 1).padStart(4, "0");
const filePath = Inbox/${nextNo + " " + title}.md
;
if (tp.file.exists(title)) {
new Notice(Error: ${filePath} is already existed.
);
return;
}
const date = tp.date.now("YYYY-MM-DD");
const noteBody = `---
date: ${date}
aliases: []
tags: " #$ {tp.date.now("YYYY-MM-DD")} #Inbox "
${tp.file.cursor()}`;
const createdFile = await app.vault.create(filePath, noteBody); await this.app.vault.modify(inboxFile, nextNo); app.workspace.openLinkText("", createdFile.path, true); %>