Indeed, as rrrrutdk mentions, you can only create macros as new action bar items (though you can then set hotkeys for them)
However, here are a few I had made for my hunter in case you find them useful in any way.
My main 'attack' macro (I use Shift+A as the hotkey):
This will do nothing if flying, dismount if you are mounted, set the target to be whatever the mouse is over unless you are not yet in combat and already have a different target selected.
If the target exists, is attackable and your pet is active, it will put your pet into defensive mode and cast hunters mark (or sting if it cant for some reason. eg there is already a mark on the target) and send your pet into attack.
Assist focus macro (I use Ahift+S)
/focus [target=focus,noexists,pet] pet
/target [target=focustarget,exists,nodead,harm] focus
This auto sets the focus to your pet if it is not set as something else (eg in a group, your tank would be the focus)
Targets the target of the focus, casts serpent sting and begins auto attack.
Attack previous target (I use Shift+D)
This is just a quick way of resuming your attack on your previous target (in case you accidentally deselected it, or looted or something. You could also put an extra /cast xxxx in there.
this will cancel any other spell in progress to cast mend pet instead (so long as you have a pet) and if in combat and your target still exists, will begin/resume attacking after mending pet.
If you hold shift while clicking on the icon, it will also turn your pet into passive mode thus retreating your pet from combat if its taking a real beating and needs extra time for the mend pet to kick in. It will of course still have aggro, but it gets it out of immediate range.