Pretty much the same thing, but this is the macro I have triggered by my "Home" key:

Code:
/script ChatFrame1:AddMessage("frame name: " .. GetMouseFocus():GetName())
I just mouse over the thing I need the name of and hit Home.