Skip to content

Conditional execution of another macro #1460

@TheStaticMage

Description

@TheStaticMage

Background

Hopefully evident from the screen capture, but I am in the actions of one macro, and I want to call another macro that has conditions. I want those conditions to be evaluated and then either for the actions or else-actions to be executed accordingly.

Image

The "Scene: Full from Split" is a macro that I call from various places (kind of like DRY programming within AdvSS, to avoid copying the same stuff all over the place). Notably, "Scene: Full from Split" is paused so that the only way it gets triggered is from another macro.

Solution

Unless there is a better way to do this that I'm missing, my suggestion would be to enhance the Macro action with an option like "Execute macro" [List of macros] (or maybe call it "evaluate macro" or "trigger macro"). This would force AdvSS to evaluate that macro immediately, even if paused, and not proceed down the list of actions until it was finished.

Alternatives

I realize that I could use a nested macro. However that violates the DRY implementation I am trying to achieve here.

Nested macros allowed me to get rid of a lot of implementations that looked like this one, so 💞 for that feature! I've only got a handful of these other ones left.

Anything else we should know?

This might not be a super high priority since a workaround exists. And if there's a better way to do what I'm trying to do here, it may not be desired at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions