obsidian-macros
obsidian-macros copied to clipboard
Allow single-command macros
Thanks for this wonderful plugin....
Is there a particular reason why it requires two commands to be added, before a macro can be saved?
if (this.coms.length >= 2 && command.name && command.icon) {
const cbtn = createEl("button", { text: "Create Macro" })
btnDiv.appendChild(cbtn);
cbtn.addEventListener("click", () => {
this.addCommand();
});
}
I was wanting to iterate on a new command, and wanted to start by adding only one command, and later modifying it (by editing the json file).
It took me several attempts to work out why clicking the x button at top-right didn't save the macro after I'd added a command... I kept losing the name, icon and command.
Eventually I added a second non-sense unwanted command, and then the "Create Macro" button appeared.
Single-command macros have value in providing shorter names - or aliases - to existing commands, I feel.
Unless there is a particular reason to required two commands, I feel the UI would be clearer if the "Create Macro" command appeared after the first command were added.
(Even better would be for it to be present-but-disabled until it can be selected - although I don't know if that is possible)
Thanks again!
No reason really, just thought it wouldn't make much sense. I will remove this restriction with the next update.
Super - thank you!