In the classic client you can set up a macro to do the following
TargetNearestMobile
AttackSelectedTarget
Useability Primary(or Secondary)
optional, honor target, cast spell etc but you'll need to work out the proper delays.
Tap the button once and it will find, attack and toggle your ability. It also seems backwards to set the ability last since you want it to hit straight away but it's the only way to give you a visual clue that the button cycled through all of the steps. If you put it first you sometimes end up with the ability active but no target and tapping it again turns it off and attacks.
Always good to have as a backup in case you need to shut down a script that is bugging out.