Loving what you are doing with Actions for Obsidian. I’m hoping it will solve some problems that AdvancedURI isn’t, and, at the same time, make shortcuts easier and more readable. I am running into one issue: it appears I have to specify the path to the note. That seems strange, as I don’t want to encode my vault layout unnecessarily in other tools. Kinda makes it hard to refactor on the fly. Apologies if I am just missing something, but if the path is required, I’d sure like to know why and request a path-less note capability. Thanks!
Welcome aboard, @Brian_Batchelder!
I’ve built it that way because when you have various notes with the same name (e.g., I have a “Roadmap” note for each of my bigger projects) you want to specify the full path to get the correct one. Making paths explicit prevents accidental foot guns since many of AfO’s actions can be destructive.
What other behavior would you expect here? I’m open to suggestions and ideas
Hmm. I’m all for not accidentally shooting myself in the foot, but I do like the option. Maybe with a heavy warning. I have some thoughts:
- Explicit path means use that specific note. Just passing a note name means find that note and use it. If multiple notes match the name, fail with “multiple matching notes” error (just like “no matching note”).
- Same thing, except require setting a flag to mean “search for note in vault”. Keep current definition of path / note name the same when flag is not set.
Check for note could also be extended to return a flag that indicates “multiple notes match name”. This could also grow into some regex-matching in the future.
PS - Thanks for this incredible tool!
I use Data Jar for these global settings in a dictionary for “obsidian”, which includes keys for vault name and various paths that I use. Then I can use get a specific value by key when needed. I can either embed it directly in an Actions for Obsidian action, or explicitly use Get Value from Data Jar and Set Variable, if I want to use it several times. If I ever change Obsidian, I only have to update it in Data Jar, and all my shortcuts automatically use the new setting. This seems to work well.
Thanks for the explanation! I see your point but also, you’re the first customer to ask for this behaviour.
Currently, AfO (or more specifically, its companion plugin Actions URI) uses the “open file X” functions of the Obsidian API, which expect an absolute file path starting at the root of the vault. The quite user-friendly behavior in the Obsidian application of finding a file by its name isn’t exposed in the API, so I’d have to recreate it. While it’s likely not overly complicated, it is a potentially breaking change, and I need to think about the ramifications before implementing it.