Need help with a macro

I am trying to create a whisper mouse-over macro fro AV. I have a macro that works within my server but when i get in a AV game it doesn’t work cross realm. Here tha macro that I am using.

/script if UnitName(“target”) then SendChatMessage(“Text” ,“WHISPER” ,nil ,UnitName(“target”)) end

But this macro only works within my server but not cross realm when i actually need it while in AV.

If any anyone with experience in scripting that could help, it be appreciated.

I doubt you’ll get much help here. I certainly don’t know the answer. Luckily there’s a forum for that - https://us.forums.blizzard.com/en/wow/c/guides/ui-macro/35