I do this with macro chaining.
Macro Name: _TGT1 (read _ as space - it helps - trust me)
Macro Placement: ButtonFrameName1
Macro Text:
/dismount
/cleartarget [noharm][dead][mod]
/targetenemy [noexists][noharm][dead][mod]
/click ButtonFrameName2
Macro Name: _TGT2 (Hunter Only)
Macro Placement: ButtonFrameName2
Macro Text:
/petautocaston [nogroup:raid][@focus,exists,nohelp][@focus,noexists][@focus,dead]Growl
/petautocastoff [group,@focus,help,nodead][group:raid]Growl
/cast [nogroup:raid,group,@focus,help,nodead][@pet,exists,nodead]Misdirection
/click ButtonFrameName3
Macro Name: _TGT3 (Hunter Only)
Macro Placement: ButtonFrameName3
Macro Text:
/petattack
/petassist
/cast Bite
/cast Claw
/cast Smack
Macro Name: Targeted Ability
Macro Placement: Discretionary
Macro Text:
#showtooltip
/click ButtonFrameName1
/cast [@mouseover,harm,nodead][harm,nodead][]Targeted Ability
This has the effect of continuing to attack whatever you’re already attacking unless that thing dies, becomes unharmable in some game-mechanics way, or you indicate that you want to switch to the NEW nearest target in your forward cone by holding down any modifier key.
Either because you’re changing targets or because you don’t have one, the nearest target in your forward cone will be selected as your target and you (and your pet(s) if you’re a hunter) will attack switch to that new target seamlessly.
That can be overridden on a temporary basis by mousing over an live enemy unit in which case the attack will be directed to your mouseover unit for as long you it remains your mouseover unit and then it will return to your target unit when you move off of it.
Each of your targeted abilities should be set up this way. Doesn’t matter if it’s just an interrupt or a polymorph that you THINK you’ll only use on mouseover. Set it up this way and if your actual target unit needs to be interrupted or sheeped, it’ll be ready. If you need a different unit to be interrupted or sheeped, mouseing over it will work just fine (see below).
I’ve been using this or something very like it for years and it works very well.
It can be tweaked - you can set your CVARS to prefer enemy PLAYERS for complex battlegrounds (think - EPIC BGs) or you can insert a macro in the chain for priority raid targets that sometimes need to be focused down when they pop up, but the basic structure is sound and proven.