Help with Target of Target modifier macro

Hi,

I’m trying to make a macro so I dont have to keep switching from the tank to an enemy when I do damage.
Ideally When I’m healing the tank I can press SW pain with no mod and smite and penace and mindblast with the other mods without dropping the tank.

This is what I have got but cant seem to get it to work.

#showtooltip
/cast [nomodifier}[harm] ;Shadow Word: Pain [@targettarget] Shadow Word: Pain
/cast [mod:ctrl]{harm] ;Smite [@targettarget] smite
/cast [mod:alt]{harm] ;mind blast[@targettarget] mind blast
/cast [mod:shift]{harm] ;penance[@targettarget] Penance

Thanks for the help guys!!

You’ve got a ton of bad syntax in there, most notably repeated uses of { rather than [

[this, and this]
[this] [or this]
; else this
#showtooltip
/cast [mod:ctrl,harm][mod:ctrl,@targettarget,harm][mod:ctrl]Smite;[mod:alt,harm][mod:alt,@targettarget,harm][mod:alt]Mind Blast;[mod:shift,harm][mod:shift,@targettarget,harm][mod:shift]Penance;[harm][@targettarget,harm][]Shadow Word: Pain

Legend! thanks