chrisgrieser / shimmering-obsidian

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

Feature Request: Allow to create new notes without switching focus to obsidian #162

Closed IevgeniiB closed 7 months ago

IevgeniiB commented 7 months ago

Feature Requested

The feature request is related to the workflow for creating new notes. When I create a new note - the following happens:

Instead of this - I want Alfred to create a new note for me in the background without switching the focus. It will help me to make new notes with fewer distractions and have them available to add more context later when I have time that I can dedicate to it.

The second item is possible for me to implement in Alfred workflows, similarly to how it's handled with adding more notes to the scratchpad, but I'm not sure how to avoid switching the focus to Obsidian when it has to refresh metadata here https://github.com/chrisgrieser/shimmering-obsidian/blob/b8c9a6c949badaadc3c2383e5695e72d8a5ac3e1/scripts/new-note.js#L65

As a workaround - I can append to scratchpad and then sort things after. The downside of this - is I will do the extra work of creating new notes from the items in the scratchpad, and I will also have to add dates to the items in the scratchpad while I add them to properties in the new notes using the folder templates.

Relevant Screenshot

No response

Checklist

chrisgrieser commented 7 months ago

Is this a question how to implement background metadata refreshing or is it a feature request?

In case it is the former, I think calling the URI you linked via open -g is what you want. It opens an URL in the background, thus preventing focus to switch to Obsidian.

If you do not need the note available in this workflow search right after creating it, you could also just skip the refreshing, since the metadata extractor plugin already refreshes every 30 minutes (and you can adjust the interval in its settings)

IevgeniiB commented 7 months ago

This is great!

I should be able to make the changes to the new-note.js script on my own, although I think that it can still be an improvement for this integration (maybe behind a flag) in case if more people will be exploring ways to avoid switching the context to obsidian.

I feel like I know what to do now, thank you for your help, appreciate the fast response too 🙇🏻

chrisgrieser commented 7 months ago

Sure, feel free to make a PR to add such an option