Skip to content

Commit a111204

Browse files
authored
fix(macros): resolve member access across all user scripts (#1155)
* fix(macros): resolve member access across macro scripts * codex: remove plan file from PR (#1155)
1 parent 88647aa commit a111204

7 files changed

Lines changed: 776 additions & 240 deletions

File tree

docs/docs/Choices/MacroChoice.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,22 @@ You can skip the selection prompt by specifying the function directly:
389389
- `{{MACRO:MyMacro::option1}}` - Runs option1 directly
390390
- `{{MACRO:MyMacro::start}}` - Runs the start function
391391

392+
When a macro has more than one user script, `Macro::member` uses the script
393+
that uniquely exports the requested member across all scripts in the macro.
394+
395+
QuickAdd resolves `Macro::member` like this:
396+
- If exactly one script exports the requested member, QuickAdd uses it.
397+
- If no script exports the requested member, QuickAdd stops and shows an error.
398+
- If multiple scripts export the requested member, QuickAdd stops and lists the
399+
conflicting script names instead of guessing.
400+
401+
If there is a conflict, you can target a specific script by name:
402+
- `{{MACRO:MyMacro::Script 1::option1}}`
403+
404+
The script selector uses the macro command name shown in the editor. If multiple
405+
user-script commands share the same name, rename one of them before using the
406+
selector form.
407+
392408
## Macro Settings
393409

394410
![Macro Manager](https://user-images.githubusercontent.com/29108628/121774198-81924a80-cb81-11eb-9f80-9816263e4b6f.png)

0 commit comments

Comments
 (0)