I don't really have one. e_e I did, and I deleted it in the end, but it shouldn't be relevant... My question was how to do it, not to have my code fixed. I don't understand where I need to put the attribute-altering code in order for it to work. Look at the thread I linked--I was trying to emulate that with a different unit name.
I created a frame that inherited SecureFrameTemplate and tried to make a button that did this OnClick:
Code:
local foo = " Ingensu";
ThisIsMySecureFrame:SetAttribute("type1", "macro")
ThisIsMySecureFrame:SetAttribute("macrotext", "/target" ..foo)