Pattern matching for macro names (disable, etc.)

It would be VERY helpful if we could stop, enable, disable (etc.) macros based on a part of the name, such as by using "* ScrOn" to specify macros named "Whatever ScrOn" to stop when the screen comes on. In this way whole groups of macros could be handled by one statement or variable.

I've been trying to streamline groups of macros that handle my WiFi switching, reminders, etc., all of which are handled differently at different times of day, AND based on my location. This would be INCREDIBLY easy if I could just include categories in the macro names themselves and call them out en masse with one function.

For example if I have several macros that I want running constantly except when I'm at home, OR when it's night, OR to stop temporarily when the screen is turned on, I could name the macro (for example "Complex Reminder Hom Nyt ScOn." Every macro could be named this way, and then one Stop Macro action could handle all of them under specific conditions by specifying the name "* Nyt *" for example. And, if you want to include or exclude existing macros from those groups, all you have to do is change the name and it joins or leaves the group, you don't have to edit a single macro.
 

Dm114

Well-known member
It would be VERY helpful if we could stop, enable, disable (etc.) macros based on a part of the name, such as by using "* ScrOn" to specify macros named "Whatever ScrOn" to stop when the screen comes on. In this way whole groups of macros could be handled by one statement or variable.

I've been trying to streamline groups of macros that handle my WiFi switching, reminders, etc., all of which are handled differently at different times of day, AND based on my location. This would be INCREDIBLY easy if I could just include categories in the macro names themselves and call them out en masse with one function.

For example if I have several macros that I want running constantly except when I'm at home, OR when it's night, OR to stop temporarily when the screen is turned on, I could name the macro (for example "Complex Reminder Hom Nyt ScOn." Every macro could be named this way, and then one Stop Macro action could handle all of them under specific conditions by specifying the name "* Nyt *" for example. And, if you want to include or exclude existing macros from those groups, all you have to do is change the name and it joins or leaves the group, you don't have to edit a single macro.
Why wouldn't you use Categories and gather your macros by category?
 

Dm114

Well-known member
You can't have a macro in more than one category, but you can have more than one identifier in the name.
What I do you could help you finding a solution. To avoid having same triggers firing in several macros, I created 2 main ones gathering all triggers needed by my macros (one for all time based triggers, another for all other kinds of triggers). When firing, each trigger runs the appropriate macro(s). So most of my macros have no triggers and are run either by my "Trigger-macros" or by any other mean (manually, MD drawer, shortcut, personal Menu...)

The other advantage is to avoid MD from loading all unnecessarily macros as many of them are disabled and can be launch programmatically in this state.

According to your problem, you could create several mini-macros containing triggers related to a specific category and launching the appropriate macro(s). Each of these mini-macros (that could be partially duplicated) would be stored in specific enabled/disabled Categories according to your criteria.

Main macros (those with Actions to be run) could be stored (and disabled to free MD space) in a particular category such as "Main Macros" or sub-categories.

As far as I understood your (a bit uncommon) problem and request, I think it could help you finding a solution.
 
What I do you could help you finding a solution. To avoid having same triggers firing in several macros, I created 2 main ones gathering all triggers needed by my macros (one for all time based triggers, another for all other kinds of triggers). When firing, each trigger runs the appropriate macro(s). So most of my macros have no triggers and are run either by my "Trigger-macros" or by any other mean (manually, MD drawer, shortcut, personal Menu...)

The other advantage is to avoid MD from loading all unnecessarily macros as many of them are disabled and can be launch programmatically in this state.

According to your problem, you could create several mini-macros containing triggers related to a specific category and launching the appropriate macro(s). Each of these mini-macros (that could be partially duplicated) would be stored in specific enabled/disabled Categories according to your criteria.

Main macros (those with Actions to be run) could be stored (and disabled to free MD space) in a particular category such as "Main Macros" or sub-categories.

As far as I understood your (a bit uncommon) problem and request, I think it could help you finding a solution.
What you're suggesting is even more work than the standard way. If I make one macro to control time-based triggers, one for location-based, one for WiFi-status based, then I have to add an "else" clause to those for each new macro I make. And if I decide to remove or merge a couple of macros, I will likely have to remove/disable a matching "else" clause in at least one other Trigger macro. If the Dev would just allow us to use glob patterns as the macro names in macro actions, nothing else would be necessary. My way is incredibly more easy.

Also it's not uncommon, nor a problem. It's just an easier way to handle macro control.
 

Dm114

Well-known member
What you're suggesting is even more work than the standard way. If I make one macro to control time-based triggers, one for location-based, one for WiFi-status based, then I have to add an "else" clause to those for each new macro I make. And if I decide to remove or merge a couple of macros, I will likely have to remove/disable a matching "else" clause in at least one other Trigger macro. If the Dev would just allow us to use glob patterns as the macro names in macro actions, nothing else would be necessary. My way is incredibly more easy.

Also it's not uncommon, nor a problem. It's just an easier way to handle macro control.
My suggestion in not a solution, just a workaround I've been using for years in a slightly different way that what you could have done.

This suggestion was in case Dev couldn't fulfill your request for some reasons.

Many of us are sure our problems or requests are simple or should concern the MD worldwide community... 😉
 
Last edited:
Top