If you wish to go from passive, to attacking a nearby mob in one macro first of all enable 'direct targetting' (/dtar on).
Then in a macro use this....

/tenemy
/bm

That should lock you onto the nearest enemy and draw your weapon ready for auto-attacking.

I hope this is what you are looking for