Disenchant Macro

I used to use below macro for the mouseover disenchant. It still works but give me an error message. Anyone know one that works and does not generate error messages?

#showtooltip Disenchant
/run local f=DeM or CreateFrame(“Button”,“DeM”,nil,“SecureActionButtonTemplate”) f:SetAttribute(“type”,“click”) f:SetAttribute(“clickbutton”,GetMouseFocus())
/cast Disenchant
/click DeM 1 1

1028x [string “local f=DeM or CreateFrame(“Button”,“DeM”,n…”]:1: attempt to call global ‘GetMouseFocus’ (a nil value)
[string “local f=DeM or CreateFrame(“Button”,“DeM”,nil,“SecureActionButtonTemplate”) f:SetAttribute(“type”,“click”) f:SetAttribute(“clickbutton”,GetMouseFocus())”]:1: in main chunk
[string “=[C]”]: in function RunScript' [string "@Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:2296: in function ?’
[string “@Blizzard_ChatFrameBase/Mainline/ChatFrame.lua”]:5479: in function ChatEdit_ParseText' [string "@Blizzard_ChatFrameBase/Mainline/ChatFrame.lua"]:5131: in function <Blizzard_ChatFrameBase/Mainline/ChatFrame.lua:5130> [string "=[C]"]: in function ChatEdit_SendText’
[string “@Blizzard_ChatFrameBase/Mainline/ChatFrame.lua”]:3308: in function <Blizzard_ChatFrameBase/Mainline/ChatFrame.lua:3302>
[string “=[C]”]: in function UseAction' [string "@Blizzard_FrameXML/Mainline/SecureTemplates.lua"]:342: in function handler’
[string “@Blizzard_FrameXML/Mainline/SecureTemplates.lua”]:667: in function <…ddOns/Blizzard_FrameXML/Mainline/SecureTemplates.lua:649>
[string “@Blizzard_FrameXML/Mainline/SecureTemplates.lua”]:681: in function <…ddOns/Blizzard_FrameXML/Mainline/SecureTemplates.lua:674>
[string “@Blizzard_FrameXML/Mainline/SecureTemplates.lua”]:723: in function <…ddOns/Blizzard_FrameXML/Mainline/SecureTemplates.lua:707>
[string “=[C]”]: ?
[string “@Blizzard_FrameXML/SecureHandlers.lua”]:266: in function <Blizzard_FrameXML/SecureHandlers.lua:263>
[string “=[C]”]: ?
[string “@Blizzard_FrameXML/SecureHandlers.lua”]:296: in function <Blizzard_FrameXML/SecureHandlers.lua:279>
[string “=(tail call)”]: ?

Locals:
f = DeM {
}
(*temporary) = DeM {
}
(*temporary) = “clickbutton”
(*temporary) = nil
(*temporary) = “attempt to call global ‘GetMouseFocus’ (a nil value)”

It’s GetMouseFoci now
https://warcraft.wiki.gg/wiki/API_GetMouseFoci

#showtooltip Disenchant
/run local f=DeM or CreateFrame("Button","DeM",nil,"SecureActionButtonTemplate") f:SetAttribute("type","click") f:SetAttribute("clickbutton",GetMouseFoci()[1])
/cast Disenchant
/click DeM 1 1
1 Like

That was it. It works now. Tyvm!

Oh great sage, I grovel at your feet for this info. Please tell me, how do lowly peons like myself find this information? It doesn’t seem to be readily available. I go to pages looking for API changes, and I encounter blank page after blank page. Addon devs get this, why can we? It’s almost like a craft secret only revealed by monks in Himalayan monasteries, lol.

Also, GetName has also changed. Do you know what that was changed to?

https://warcraft.wiki.gg/wiki/World_of_Warcraft_API
CTRL-F search for whatever ur after.

And this is the very latest??

Yup.

10chars