Okay, jumped on my druid to test things out - Noticed there are no Claw or Ravage abilities in Retail, so changed to Rake for Stealth and Mangle for non Stealth alternatives.
I took out the /StartAttack line as it skewed my tests with extra messages.
Alternative Macro
Lua Code:
#showtooltip
/cast [stealth] Rake; [form:1] Mangle; [form:2] Shred; [@mouseover,help,nodead][] Regrowth
Spec: Feral
Cat in Stealth: Rake Icon - Nothing to Attack Message
Cat in Non Stealth : Shred Icon - Nothing to Attack Message
Bear : Mangle Icon - Nothing to Attack Message
Travel and Caster : Changes to Regrowth Icon and casts spell
Spec: Guardian
Cat in Stealth: No Icon - Doest Nothing
Cat in Non Stealth : Shred Icon - Nothing to Attack Message
Bear : Mangle Icon - Nothing to Attack Message
Travel and Caster : Regrowth Icon - Casts Regrowth in Caster Form
Spec: Restoration
Cat in Stealth: No Icon - Does nothing
Cat in Non Stealth : Shred Icon - Nothing to Attack Message
Bear : Mangle Icon - Nothing to Attack Message
Travel and Caster : Regrowth Icon - Casts Regrowth in Caster Form
Moonkin : Regrowth Icon - Casts Regrowth in Moonkin Form
Results:
If the ability isn't available it does nothing
If the ability is available it will try to use it
Suggestion:
Maybe put the Regrowth cast on a separate line for a fallback if no skills are available
And add additional checks for harm/exists etc so that it will fall through if those tests fail
And as Kanegasi points out, version matters, so adjust accordingly