If you can't already tell, I'm still new to the game. I'm trying to figure out if it is possible to have macro that will do the following: If I have a friendly targeted (tank) it will assist him and perform an action. If I don't have a friendly targeted, the action will work as normal.
So here is my scenario that this would be useful: I'm a DD in a group. While there aren't any adds that need to be taken care of I simply target the tank and fire away. When adds or groups are involved I can either continue assisting the tank by leaving him selected or I can swap over to an enemy if that is what is needed.

I used to use a similar macro when I played WoW and it was great at avoiding aggro (i wasn't always quick enough at swapping and this made it much better)while still allowing me to do all my hunter duties. The one I was using was a bit more complicated than this but this should get the job done. I would really appreciate any help.