Having the same issue, I even tried to contact a GM and ask about.. maybe I just was too dumb to realize how to do that
Well, as general he suggested to delete "Interface", "WTF" and "Cache" folder, so I made a copy of them and gave it a try.
Having stanadard-UI and resetting all the ingame-settings I was standing in front of a training dummy. Cleared my current target and just pressed/clicked autoshot and instantly the nearest dummy was selected as my target - but not directly attacked.
As it seems that even with standard-WoW this happens the GM told me that he will forward this issue to some technician so that they will have a look at this and maybe fix it (well I actually don't think so, as playing on a european realm).
Currently being at work I can't test your macro-suggestion at the moment, but I still hope that there's another way to solve this than macro'ing every single ranged-skill I have :/
Klingo