chrisgrieser/shimmering-obsidian

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

IevgeniiB opened this issue · 3 comments

Feature Requested

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

  • My current focus switches to obsidian for the metadata to be created.
  • My current focus switches to the new note so I can add more context.

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

app.openLocation(`obsidian://advanced-uri?vault=${vaultNameEnc}&commandid=metadata-extractor%253Awrite-metadata-json`)

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

  • The feature would be useful to more users than just me.
  • I have checked the feature overview and the feature doesn't already exist.
  • Feature Requests regarding daily notes will not be implemented, since there are other Alfred workflows that do focus on daily notes already.
  • If it is an entirely new feature: The requested feature makes more sense to be implemented in Alfred than in a plugin. Please also explain why.

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)

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 🙇🏻

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