A multi-function button (also known as a "three button") let's you do that:
https://www.gpsoft.com.au/help/opus12/index.html#!Documents/Multiple_Function_Buttons.htm
If you're using the button to empty the recycle bin I posted yesterday, may want to change the @icon
in the first command to @icon!
so it affects the main icon on the toolbar.