shabegom / buttons

Buttons in Obsidian
The Unlicense
453 stars 47 forks source link

Create folder for new note if it doesn't exist #199

Closed SabriDW closed 5 months ago

SabriDW commented 6 months ago

This creates the folder if the new note's path if it doesn't exist. Useful for organizing the children of a "parent" note template into their own folder using templater.

Example Use-case

This button is in a recurring meeting note which hosts a bunch of "children" meeting notes

```button
name New Meeting
type note(Notes/Meetings/<%tp.file.title%>/<%tp.file.title%> <%tp.date.now()%> Meeting, split) template
action Meeting Template
templater true


Currently if the `<%tp.file.title%>` folder doesn't exist, it throws a "There was an error! Maybe the file already exists?" error. This PR changes the behavor by creating the folder when one doesn't exist.