Sorry, it looks like I haven't been clear enough in my question. I do not want to use different macros depending on my target or on the button I press. Basically, what I want to do is to announce the group of my target, assuming that I'm in a raid. Let's say that I have an AnnouceGroup(unitID) function somewhere in an addon, and if there was a "clique_unit" unitID (local to my macro, somehow, don't ask me how), I would end up writing:
Code:
/cast MySpell
/run AnnounceGroup("clique_unit")
My problem is that, as for spells that are cast by casting the spell with no target (or a bad target) first (making your cursor shine in blue) and clicking your target after, the macro has no way (that I know) to guess who it's being applied to.
One solution that comes to my mind would be to (*sigh*) parse the combat log (but for buffs... as the target doesn't appear... and as it'll be changed next patch...). There must be something easier!