# Activate/Deactivate Preset by Name with wildcards

It would be extremely handy to be able to Activate/Deactivate Presets by ‘Name Includes’.
So I have 10 Presets that have ‘LED’s set by global variable’ in the name and I can Activate/Deactivate them all with one Translator.
Deactivate Preset --------- Name Includes--------‘LED’s set by global variable’

Interesting idea. I’ll see that it is added to the request list. You do know that you can set up a timer to iterate through preset numbers and activate or deactive them by number right?

Say you want to activate presets 3, 4 and 6

Timer output “Activate 3-4-6” repeat gc times
Rules:
gc=3

Incoming “Timer Activate 3-4-6”

Rules:
pp=gc
gc=gc-1
if pp== 3 then qq=3
if pp==2 then qq=4
if pp==1 then qq=6
Outgoing “Activate Preset qq”

One issue with doing wild card named presets would be that you would have to be careful new presets didn’t have the same wildcard pattern unless it is intentional.

Of course with numbered presets, if you move things around you have to remember to change the numbers of a translator like the above.

Consequently, I like to always group numbered translators together and make a note not to ungroup them. I can then use math to offset the beginning translator in a given group.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services: bome@sniz.biz
1 Like

Hi,
That works a treat!. Any chance you could explain what gc=gc-1 means. I can sort of work out the rest of the rules, but this one didn’t seem to click with me.
I understand this:
if pp== 3 then qq=3
pp is the count number and qq=3 means activate preset 3
But gc=gc-1 what does this do?

I use gc as a counter. I set the value to 3 when I trigger the repeated event.
On each repeat, it counts down with gc=gc-1

Then we look at the current count to determine which preset we want to activate.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services: bome@sniz.biz
1 Like

regarding your original post, I think the following additions to MT Pro will go a long way:

1. allow wildcards `*` and `?` in the preset name
2. allow to embed variables in the preset name. E.g.: `LED Switcher %g1%`, it will enable/disable a preset named `LED Switcher 1` if g1 has value 1, but `LED Switcher 2` if g1 has value 2.

Feature requests recorded. Thanks!

2 Likes