Hi all, just started getting into using WeakAuras and had a question I couldn't seem to find an answer to anywhere. I was wondering if it was possible to make a button in WA, that when clicked would start a spec change. I know it can be done with macros but I can't seem to find a way to do it with WA. I managed to find a tutorial to make a clickable button like so (currently hooked up to casting Detox just to test that it worked):

Code:
function()
    local r=WeakAuras.regions['SpecIcon'].region
    local b=CreateFrame("Button","MyButton",r,"SecureActionButtonTemplate")
    
    b:SetAllPoints()
    b:SetAttribute("unit","player")
    b:SetAttribute("spell","Detox")
    b:SetAttribute("type","spell")
    
    if GetActiveSpecGroup() == 1 then
        return true
    else
        return false
    end
end
but i'm not sure where to go from here to make it so that "detox" cast is instead the cast to swap specs. Can it be done and if so could anyone point me in the right direction?