Macro to show targets tooltip on keypress?

Does there exist a macro that would allow me to toggle on/off a target’s tooltip without having to mouseover their unitframe and/or model?

I know there exists the option “Show Target Tooltip” which is essentially what I’m asking for, but I don’t necessarily want the tooltip visible at all times, just when I press the macro to turn it on/off.

/run if GameTooltip:IsShown() then GameTooltip:Hide() return end if not UnitExists("target") then return end GameTooltip_SetDefaultAnchor(GameTooltip, TargetFrame) UnitFrame_OnEnter(TargetFrame)

Requires a target unit to be selected.

It doesn’t discrimate about hiding the tooltip. If it’s shown for any purpose the macro will hide it.

Thank you! I really appreciate you creating this for me :slight_smile: