My sheep macro was as simple as this:
Code:
#showtooltip Polymorph
/cast [button:2,@focus] Polymorph;
/focus [nobutton:2];
I'm not sure if a test for an existing focus is available but maybe the following will do what you want.
Code:
#showtooltip Polymorph
/cast [button:2,@focus] Polymorph;
/focus [nobutton:2,noexists];
/clearfocus [nobutton:2,exists];
button 2 is the right mouse, so nobutton 2 means left or other button.