chrisgrieser / shimmering-obsidian

Alfred Workflow with dozens of features for controlling your Obsidian vault.
https://alfred.app/workflows/chrisgrieser/shimmering-obsidian/
MIT License
850 stars 41 forks source link

[Bug]: Opening new note -> template is not applied #62

Closed bdirinck closed 2 years ago

bdirinck commented 2 years ago

Bug Description

When I type ’on + (title)‘ to open a new note, the note is created in the right folder and with the correct title, but without the requested template. Can you give an example of what should be in the configuration field if the template is located under ‘VaultName'/999-Templates/New Input/Basic_note.md

Thank you

Regards

-Benny

PS: GitHb reported that the text in the debugging log was too large to post. As a result, I had to delete a large chunk of text in the Debugging Log. The entire text of my notes was shown in the log. I think I left the most relevant part.

2022-03-02-screenshot-6

Relevant Screenshot

The template that should be applied but doesn't

2022-03-02-screenshot-2

To Reproduce

  1. Set configuration as in screenshot
  2. Type command => 'on' + title in Alfred (in this example the title is 'TestNote'
2022-03-02-screenshot-4

Debugging Log

[22:07:04.254] Logging Started...
[22:07:10.366] Shimmering Obsidian[Script Filter] Queuing argument '(null)'
[22:07:10.715] Shimmering Obsidian[Script Filter] Script with argv '(null)' finished
[22:07:10.718] Shimmering Obsidian[Script Filter] {"items":[{"title":"__ToDo","match":"  ToDo __ToDo #task filename name title","subtitle":"▸ /","arg":"__ToDo.md","quicklookurl":"/Users/benny/Library/Mobile Documents/iCloud~md~obsidian/Documents/Ben notes/999-Templates/Temporal/Annual Note.md","type":"file:skipcheck","uid":"999-Templates/Temporal/Annual Note.md","icon":{"path":"icons/note.png"},"mods":{"shift":{"valid":false,"subtitle":"⛔️ Note without Outgoing Links or Backlinks"}}},{"title":"🗒 Basic Note","match":"🗒 Basic Note 🗒 Basic Note #triage filename name title","subtitle":"▸ 999-Templates/New Input","arg":"999-Templates/New Input/🗒 Basic Note.md","quicklookurl":"/Users/benny/Library/Mobile Documents/iCloud~md~obsidian/Documents/Ben notes/999-Templates/New Input/🗒 Basic Note.md","type":"file:skipcheck","uid":"999-Templates/New Input/🗒 Basic Note.md","icon":{"path":"icons/note.png"},"mods":{"shift":{"valid":false,"subtitle":"⛔️ Note without Outgoing Links or Backlinks"}}},{"title":"🗓 Daily Note","match":"🗓 Daily Note 🗓 Daily Note #in-progress #daily-note filename name title","subtitle":"▸ 999-Templates/New Input","arg":"999-Templates/New Input/🗓 Daily Note.md","quicklookurl":"/Users/benny/Library/Mobile Documents/iCloud~md~obsidian/Documents/Ben notes/999-Templates/New Input/🗓 Daily Note.md","type":"file:skipcheck","uid":"999-Templates/New Documents/iCloud~md~obsidian/Documents/Ben notes/999Templates/ABC.md","type":"file:skipcheck","uid":"999-Templates/ABC.md","icon":{"path":"icons/note.png"},"mods":{"shift":{"valid":false,"subtitle":"⛔️ Note without Outgoing Links or Backlinks"}}},{"title":"! tweeter","match":"! tweeter ! tweeter #️🗺️ filename name title","subtitle":"▸ 999-Templates","arg":"9 [truncated]
[22:07:18.407] Shimmering Obsidian[Keyword] Processing complete
[22:07:18.409] Shimmering Obsidian[Keyword] Passing output 'TestNote' to Conditional
[22:07:18.409] Shimmering Obsidian[Conditional] Processing complete
[22:07:18.410] Shimmering Obsidian[Conditional] Passing output 'TestNote' to Replace
[22:07:18.411] Shimmering Obsidian[Replace] Processing complete
[22:07:18.411] Shimmering Obsidian[Replace] Passing output 'TestNote' to Run Script
[22:07:18.613] Shimmering Obsidian[Run Script] Processing complete
[22:07:18.614] Shimmering Obsidian[Run Script] Passing output '000-Inbox/TestNote.md
' to Call External Trigger
[22:07:18.615] Shimmering Obsidian[External] Processing complete
[22:07:18.615] Shimmering Obsidian[External] Passing output '000-Inbox/TestNote.md
' to Conditional
[22:07:18.616] Shimmering Obsidian[Conditional] Processing complete
[22:07:18.617] Shimmering Obsidian[Conditional] Passing output '000-Inbox/TestNote.md
' to Run Script

Workflow Configuration

2022-03-02-screenshot-5

Version & System Information

-------------------------------
Metadata JSONs: 3/3
-------------------------------
INSTALLED VERSION
macOS: 10.15.7
Obsidian: .asar file missing
Alfred: 4.6.3
Workflow: 2.21.7
Advanced URI Plugin: 1.17.0
Metadata Extractor: 1.0.0
-------------------------------
LATEST VERSION
Obsidian: 0.13.23
Obsidian (Insider): 0.13.28
Workflow: 2.21.7
Advanced URI Plugin: 1.19.0
Metadata Extractor: 1.0.0
-------------------------------

Make sure you have done the following

chrisgrieser commented 2 years ago

hmm, all the version info, your configuration, and the debugging log look completely fine. The part that does the template reading is literally 2 lines of code, and there does not seem to be an issue there in the code. 🤔

The only thing I can think of, is that you have a plugin interfering, e.g. Templater's folder templates?

Otherwise I have added some more logging of potentially to the respective part of the code, please update to the newest workflow version, try again, and attach the debugging log again?

chrisgrieser commented 2 years ago

I assume this was fixed with one of the recent bug fixes, so I am closing this due to lack of response. If there is still a problem that should be solved, please open a new issue.