The WoWWiki page on Macros is excellent. It’s also hard to navigate given the “standard wiki” layout. So I’ve decided to post my macros here for my own (and anyone else’s) reference.
Cast a random mount (flying included):
/castrandom [nomounted, flyable] FLYING MOUNT NAME HERE; [nomounted] GROUND MOUNT NAME HERE
You can also add in conditionals (as shown on the WoWWiki page), but I don’t find it necessary. I mean, you should know where you can and cannot mount, right? For those of you who don’t:
Can mount flyer: Northrend and Outland, outside*
Can mount ground: Everywhere, outside, capital cities
*This will change in Cataclysm because we will be able to fly in Azeroth. :D CAN’T WAIT.