Member Access Picks First User Script Without Warning
Overview
Triggering MacroName::export currently short-circuits to the first user-script command in the macro. Commands before that script run, its export executes, and any later user scripts are ignored. This makes macros with multiple scripts behave unpredictably and gives no feedback to the user about what happened.
Why It Hurts
- Macro authors expect the export matching the suffix they typed, not whatever script appears first.
- Multi-script macros (variants, pipelines) can’t expose the right export reliably; the wrong code runs silently.
- There’s no UI, doc, or log hint describing the limitation, so it looks like the feature is broken.
Reproduction
- Create a macro with two user-script commands.
- Give the second script an export named
beta. - Run
MacroName::beta. - Observe that only the first script becomes eligible for the export.
Desired Experience
- Make it explicit which user script provides member-access exports.
- Leave single-script macros frictionless.
- Surface a clear notice when a macro isn’t configured for member access instead of guessing.
Possible Approaches
- Let authors mark exactly one user-script command as "Expose for member access" in the macro editor; auto-select when only one script exists.
- At runtime, if no script is marked (or multiple are), show a notice guiding the user to configure the macro instead of picking one.
- Update tooltips/docs to spell out the rule (
Macro::exportruns the designated user script export and ignores others). - Optionally log a warning when multiple scripts exist but none is designated, helping users catch misconfiguration in tests.
Open Questions
- Should designation live on the macro or the individual command?
- How do we migrate existing macros gracefully (auto-designate the sole script?)
Hi, Have been experimenting with QuickAdd, but have some issue to reproduce your demo vault and make it function how you describe.
In regards to your open questions, I believe it would be better to have the designation live on the macro.
Will be grateful for your help, so I can make the template and Goals/Project/Dashboard with cards work properly.
I am in the beginning of a comprehensive Sailing Boat Restoration Project involving many aspects and helpers so I want to use Obsidian and your system to keep everything organized and easily shareable with my helper friends.
Keep up the good work, looking forward to your reply
Here you can see my current view and the error messages, would love to get it Looking and working like in your Screenshots. https://bagerbach.com/blog/projects-and-goals-obsidian
Thank you