Script to collapse Buffs?

Does anyone know if it’s possible to create a small addon/script that will automatically collapse my buffs when I log in? I use /fstack and see:

BuffFrame.CollapseAndExpandButton.NormalTexture

BuffFrame.CollapseAndExpandButton.PushedTexture

I thought maybe I could do: BuffFrame:SetBuffsExpandedState(true), but that isn’t working

BuffFrame.CollapseAndExpandButton:Click()

I have no idea what knock on effects that might have.