Disable or hide an element if more parameters are set to a specific value

I couldn’t reproduce that. Seems to load ok. But now that I see what you want to do I would change the ui script a little bit.

local sourceDef = getElement():findMidiModules(true, "Lua Script")[1]:getParameterDefinition("ModSourceOSCZone1")

for i = 1, 3 do
    defineParameter("disable"..i, nil, 0, 0, 1, 1)
end

for i = 1, 4 do
    defineParameter("ModSourceOSCZone"..i, nil, sourceDef, function() checkDisable() end)
end

function checkDisable()
    local disable = {0, 0, 0}
    for i = 1, 4 do
        local source = _G["ModSourceOSCZone"..i]
        if source > 1 and source < 5 then
            disable[source - 1] = 1
        end
    end
    for i = 1, 3 do
        _G["disable"..i] = disable[i]
    end
end

But because you use script parameters to change the modulation sources you might not need ui script at all. I’ll attach 2 versions. One with ui script and one without. Try if it works for you.
TEST Multiple Disable Mini Macro 3.zip (21.4 KB)

1 Like