For Example:
I use elvui which has a farmmode-command, that toggles the minimap get bigger/smaller for a better farming overview. So I have an Ion-Bar with Herbs/Ore/whatever that I want to show/hide with this feature.
Wanna put it in a macro something like:
/farmmode
/iontoggle IonBar6