If you use standard Blizzard macros (rather than Trinity or BindPad or something similar) you could create an external app that rewrote your macros for a specific party set up from templates, you may even be able to do this in game as I am fairly sure you can create macros with lua scripts. I was going to do this myself but as I use Trinity and there is no defined file format or guarantee that the format will not change on a regular basis I decided it was not worth it.