Macros as in wow-macros can not do this kind of stuff. You also can not move your cursor with a macro or send mouse clicks for that matter.
It is possible with tools outside of wow, but that makes it 3rd party and is a ban-able offense.

I understand what you want to do. You want to click a macro to interact with a herb or mining node instead of mousing over it and clicking it.
Its not doable with macros. You'd be looking for a bot, which would find you a ban.

Wow everyone in this thread seems to be missing the point.
However that first /cast gather herb only makes your mouse "blueish" and you would still need to click on the herb manually to actually start the gathering process.

regardless of what you do, you still need to click the herb with your mouse. you cannot make a macro to gather a herb for you without there having to be some physical interaction on your part, that is what everyone is saying