If that frame has some distinctive features you might be able to use EnumerateFrames() to get a pointer to it. For example this code catches all existent action buttons (from standard UI, Bartender4, ButtonForge, Dominos etc) and new ones will be added as well. Doesn't matter if they have a name or parent. (code extracted and adapted from SetMacroIcon lib)
Lua Code:
local action_buttons = {} --this table will contain all action buttons (present and future)
local hook_all_actionbuttons
local CreateFrame_hook
local hook_new_buttons_frame = CreateFrame("Frame")
hook_new_buttons_frame:Hide()
local f = CreateFrame("Frame")
f:SetScript("OnEvent",function(self,event,...)
if event=="PLAYER_LOGIN" then
hook_all_actionbuttons()
hooksecurefunc("CreateFrame",CreateFrame_hook)
end
end)
f:RegisterEvent("PLAYER_LOGIN")
function CreateFrame_hook(frame_type,frame_name,frame_parent,frame_template)
--put code to identify viable candidates for the desired frame here (like bellow)
if string_upper(frame_type)=="CHECKBUTTON" and frame_template and string_upper(frame_template):match("ACTIONBUTTONTEMPLATE") then
hook_new_buttons_frame:Show()
end
end
do
local last_frame
function hook_all_actionbuttons()
local frame = EnumerateFrames(last_frame)
while frame do
--put code to identify the desired frame here (like bellow)
local frame_type = frame:GetObjectType()
if frame_type=="CheckButton" and frame.GetAttribute and frame.icon and frame.Border and frame.Count then
action_buttons[frame] = true
end
last_frame = frame
frame = EnumerateFrames(frame)
end
end
end
hook_new_buttons_frame:SetScript("OnUpdate",function(self,elapsed)
self:Hide()
hook_all_actionbuttons()
end)