To do that you can try this app >>> Dual Sim Selector
It's not always easy to set up, but it's pretty effective for what you want to do.
As for macrodroid and dual sim, I use it to automatically deactivate my work sim card outside of my working hours. But for that, there is no direct action (As...