Skip to content

Instantly share code, notes, and snippets.

@jdpilgrim
Created December 5, 2022 17:21
Show Gist options
  • Save jdpilgrim/0289d5d3d67315125946749db5ce20a5 to your computer and use it in GitHub Desktop.
Save jdpilgrim/0289d5d3d67315125946749db5ce20a5 to your computer and use it in GitHub Desktop.
Obsidian top matter for actions. Asks for a title
<%*
let originalTitle = tp.file.title
if (originalTitle.startsWith("Untitled")) {
originalTitle = tp.file.creation_date("YYYY-MM-DD")
}
title = await tp.system.prompt("Title");
await tp.file.rename(`${originalTitle} ${title}`);
tR += "---"
%>
title: <%* tR += `${title}` %>
allDay: true
date: <% tp.file.creation_date("YYYY-MM-DD") %>
startTime: <% tp.file.creation_date("HH:mm") %>
endTime:
completed: false
tags: [action, ]
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment