Can macro spells change depending on spec?

Enable auto-self casting in Interface > Combat and you can optimize it to 325 chars:

#showtooltip
/cast [spec:2,mod:alt,@mouseover,nodead,help][spec:2,mod:alt]Prayer of Healing;[spec:2,mod:ctrl,@mouseover,nodead,help][spec:2,mod:ctrl]Heal;[spec:2]Smite;[spec:3,mod:alt,@mouseover,nodead,harm][spec:3,mod:alt]Void Eruption;[spec:3,mod:ctrl,@mouseover,nodead,harm][spec:3,mod:ctrl]Void Torrent;[spec:3]Mind Flay

Rearrange things to set Shadow as the “default” and you land at 299 chars (same if you set Holy as the default).

#showtooltip
/cast [spec:2,mod:alt,@mouseover,nodead,help][spec:2,mod:alt]Prayer of Healing;[mod:alt,@mouseover,nodead,harm][mod:alt]Void Eruption;[spec:2,mod:ctrl,@mouseover,nodead,help][spec:2,mod:ctrl]Heal;[mod:ctrl,@mouseover,nodead,harm][mod:ctrl]Void Torrent;[spec:2]Smite;Mind Flay

Strip out the nodead checks from the mouseover tests (not ideal but that’s the next step if ur trying to fit it in 255) and you land at 261:

#showtooltip
/cast [spec:2,mod:alt,@mouseover,help][spec:2,mod:alt]Prayer of Healing;[mod:alt,@mouseover,harm][mod:alt]Void Eruption;[spec:2,mod:ctrl,@mouseover,help][spec:2,mod:ctrl]Heal;[mod:ctrl,@mouseover,harm][mod:ctrl]Void Torrent;[spec:2]Smite;Mind Flay

Unfortunately there’s not really a way to optimize past this point without losing overall functionality.

My personal macros in this style can be found here: