View Single Post
04-26-18, 03:59 AM   #3
dogmax
A Kobold Labourer
Join Date: Sep 2007
Posts: 1
You can make a useful macro that will print the names of the children of a frame you a hovering with your mouse.


This is the code you need to put in your macro:

Code:
/run function kiddos () local kiddos = { GetMouseFocus():GetChildren() }; for _, child in ipairs(kiddos) do DEFAULT_CHAT_FRAME:AddMessage(child:GetName()); end end kiddos();
It's a bit hard to decipher because code that you run in a macro needs to be on the same line.

If you want to understand the code, then here it is with multiple lines and indentations:


Code:
function kiddos () 
    local kiddos = { GetMouseFocus():GetChildren() };
    for _, child in ipairs(kiddos) do 
        DEFAULT_CHAT_FRAME:AddMessage(child:GetName());
    end
end

Then you can run the code from the chatbox like this:


Code:
/run kiddos();
Which will print the names of the child frames in the chat.