After coding this answer, where I use Templater to build a suggester of files with file aliases, ala Quick Switcher, I want to build a command which either chooses an existing file or creates a new file. But the question I would like some input on is: Where (and with which plugin) would you use to create a custom command?
So far I’ve used either Templater based commands, or variants of QuickAdd script, but this time I’m aiming for a command which should do three things:
- Have a suggester to choose a potential existing file name (or store the new file name suggestion)
- If existing, triggering an open file command (from some API)
- If not existing, trigger a Templater
So what tool would you use to create such a command? I would like for it to be assigned a hotkey, and to be able to trigger it without necessarily having an open file (which kind of rules out Templater ).
Note that I’m not asking about coding the command, just how and where to put the code which eventually creates the command within a suitable environment for me to continue from. (Although a suggestion on which command to use to open a file is appreciated )
As stated Templater is most likely ruled out since I then need to have an active editor, and I don’t really like the convoluted way of defining commands through QuickAdd (with a choice, having a macro, linked to a function file, and then configured to trigger that function… ).
This has gained a lot less traction than I hoped to, so let me try to increase the traffic by describing some of the mixture of tools I’m currently using:
dv.view()-scripts for some more Dataview related stuff
- Templater user functions for the more specific Templater stuff
- Some odd-ball CustomJS functions, but haven’t made an transition into using that
I’ve also contemplated on using the Startup template of Templater to create commands, or “misusing” dataviewjs or similar. But I’m a little worried on how to handle command updates/modification and so on.
So far my usage is 95 percent Templater Js and 5 percent QuickAdd (for stuff I saw on the internet).
Inline Scripts I tried (to look into), but the RPG theme and the default srcipts were too out of line with my use cases.
I’d like to use the DVJs oneliners with
dv.view but they they throw the promise error (or on await I get
- as “result”).