/script local f=GetSubZoneText()SendChatMessage('INCOMING '.. f,"RAID")
Change "RAID" with "BATTLEGROUND" or "PARTY" to change the channel it'll give the warning off to (also very helpful in BGs).
It doesn't feel, it doesn't think It doesn't laugh or cry All it does, from dusk till dawn Is make the soldiers die
Clever, however usually you want to know how many enemies there are as well. Hmm, I wonder...
While it wouldn't fit in a macro, it might be possible to turn it into an addon instead, which could be triggered by a command, which could be put in a macro. I don't have the API in my head, but I think that it is possible to detect nearby enemies, athough they might need to be close enough for their nameplates to show up. And, once you know that an enemy is there, it should be trivial to check whether it's a player, and also what class it is. And, since it's an addon, throwing in some code for message formatting would also be easy.
The end result would be a message akin to "Farm under attack by 4 enemies: 1 rogue, 2 mages, 1 warlock!", at the press of a button. I haven't actually looked into this though, so there might be problems with detecting nearby enemies. In either case, it is likely a bit overkill.
I more or less put this up for when we were facerolling Halaa. Something more wasn't really needed. I do know of an addon that just warns you about the opponents in your Arena team, but you see enemy frames on the right of your screen when in an arena...
I'm quite sure something so sophisticated in Battlegrounds is either impossible or illegal. I dunno.
It doesn't feel, it doesn't think It doesn't laugh or cry All it does, from dusk till dawn Is make the soldiers die