Doesn't work with pet spells[]
The function returns nil while you drag a pet spell. This seems to be the intended behavior, according to a post from Slouken.
code Example needs updating[]
GetSpellName() was replaced by GetSpellBookItemName() in 4.0.1. Particularly telling is the change is the shift of the second argument from spell rank to spell subname (eg: "Grand Master", "Racial Passive", etc.) Corwin MacGregor (talk) 11:12, 10 November 2012 (UTC)