1. /run TargetFrame:SetAttribute('item', "Heavy Frostweave Bandage")

    /run TargetFrame:SetAttribute('shift-type*', 'item')

    /run TargetFrame:SetAttribute('ctrl-type*', 'item')

    /run TargetFrame:SetAttribute('alt-type*', 'item')

    When I try using this by left clicking the portrait it didn't use bandages.

    You'd have to shift/alt/ctrl click the frame, not just click it. You would also need to have Heavy Frostweave Bandages in your bags.

    You'd have to shift/alt/ctrl click the frame, not just click it. You would also need to have Heavy Frostweave Bandages in your bags.

    I did that already doesn't work. I tried shift click, alt click and ctrl click. Nothing happened. Tried it on another player, my self, another npc. Nothing

    Also wouldn't using an asterisk mean that it would match any button? This protected stuff is confusing.

    I actually never use button wildcards, I dislike the way they work. I prefer to be completely explicit about how I'm programming my buttons. This is what I'd do to make shift-left-click on my target frame use a bandage:

     /run TargetFrame:SetAttribute("shift-item*", "Linen Bandage")
     /run TargetFrame:SetAttribute("shift-type1", "item")
    

    Looking at the FrameXML code for the user interface, it doesn't appear that wildcards are supported like this anymore, which I'm completely happy with. Try writing your code without it, and let me know if that makes more sense!

    The issue here is an attribute for "*type1" that is set by Blizzard's code. This is what allows you to left-click on your buttons and have them target the unit. In the code that resolves what action to take on which unit and of what type, it is resolving "ctrl-type1" and finding the 'target unit' type that is set by Blizzard's code.

    You can 'fix' this by setting the *type1 and *type2 attributes to nil, then setting type1 to "target" and type2 to "menu'. You can then set your attributes on top of it.

    Alternatively, you can specify the buttons in your new bindings, and it will always work. Explicit wins!

    Yeah that worked. Thanks