Do you mean something like:
Lua Code:
local button = CreateFrame('Button', 'ExitButton', nil, "InsecureActionButtonTemplate, UIPanelButtonTemplate")
button:SetText("Logout")
button:SetAttribute('type', 'macro')
button:SetPoint("CENTER")
button:SetSize(60, 24)
SLASH_MCR1 = "/mcr"
SlashCmdList["MCR"] = function(msg)
button:SetAttribute('macrotext', string.gsub(msg, '\92n', '\n'))
print(button:GetAttribute('macrotext'))
end
Slash:
Code:
/mcr /cleartarget\n/stopcasting\n/script ToggleGameMenu(); StaticPopup1:Hide()
I might not be understanding properly what you are trying to achieve.