I need help with 2 macros working together if possible

Hi, I’d like a macro for PI or any md that I can use but I usually use :
#showtooltips Power Infusion
/target *player
/cast Power Infusion

I would like to have a 2nd macro that sets the target into that 1st one instead of having to manually write the name every time. Is that a thing?

Thanks in advance

Name this one Set PI and make a blank macro called PI

/run local n=UnitName("target") or "player" if not InCombatLockdown() then EditMacro(GetMacroIndexByName("PI"),nil,nil,"#showtooltip\n/cast [@"..n.."] Power Infusion\n/cast [@player] Power Infusion") print("PI target set to "..n) end

Target the person u wanna set as ur PI traget and hit Set PI. Use PI to cast it on them.

Thanks I will try that!