Select

This addon adds the /select macro command you can use instead of /use or /cast to use an item or spell among a list. Right-clicking your macro from the bars will pop out a menu where you can change the item or spell to use.

How to Use

Create a macro with this line: /select item or spell, item or spell, etc

Drag the macro to your bars.

The first item or spell will be the default action when you hit the macro.

Right-click the macro to on your bars to change it to a different item or spell.

For instance, warriors may find this useful:

/select Battle Shout, Commanding Shout

When you create that macro it will cast Battle Shout every time it's hit. If you join a group with a death knight and want to use Commanding Shout instead, right-click the macro on your bars and choose Commanding Shout. Now the macro will display and cast Commanding Shout.

This is a standard focus-sheep macro. When you want to change what polymorph spell to use, right-click the macro on your bars and pick another. It will use that new polymorph until you decide to change it again.

Search:Keywords

To help add items and spells to your /select macros, search:keywords are usable in place of an item or spell name. These search through your bags and spellbooks to fill the flyout with items and spells that match the keyword(s).

To do its magic, Select needs to add a line like this to all macros that contain a /select command:

/click [btn:2]S001M;S001A

It will do this on its own and it will recreate this line if it's accidentally deleted or altered. You don't need to worry about it except to remember that when writing your /select macros your macro needs at least 26 characters free for it to add this line (if it's not already there).

Limitations

Only the first /select in a macro will be recognized. Any others in the same macro will be ignored.

When you create or edit a macro in combat (you should be fighting!) it will wait until you leave combat to turn the macro on or make changes from your edit.

If you gain an item or spell that wasn't available as you entered combat, that item or spell won't be in the flyout until you leave combat.

Frequently Asked Questions

Q: What action bar addons does this support?
A: All of them! Default too, of course. If you can drop a Blizzard macro onto the button then Select should work with that button. However, if the macros are outside the game's standard macro slots, Select won't be aware of them.

Q: Can I add companion pets to /select?
A: Yes and no. There's a game limitation that prevent changing the icon easily. That said, pet:name, pet:favorite and pet:any work. But be aware it uses one icon for all pets.

Q: Can I change the order that items or spells list in the menu?
A: If you want certain items to list before others, add them manually. ie: /select x-51 nether-rocket x-treme, mount:flying will list the x-51 rocket first.

Q: Tyrael's Charger is missing from my land mounts!
A: Tyrael's Charger can fly so it's grouped with the flying mounts. But if you want to add it to your land mounts you can add it manually: /select tyrael's charger, mount:land

Q: Can you make the popout menu align to the action/macro button?
A: No, sorry. The secure methods to get the menu working in combat prohibits anchoring willy nilly.

If you have any suggestions, comments or bugs to report, feel free to post them in comments here. Thanks!

Problem is the Teleport Moonglade portion doesn't work, even when I put spell: in front of it, it basically just shows the icon but will never let me switch to it as a spell or use it. I think i'm just doing it wrong otherwise i'd submit an official bug.

It looks like it has problems with all spells that have a colon in them. (Right now if it sees a colon it expects the part before the colon to be one of the search keys (mount:, spell:, item:, etc) I'll get a fix up this week for it.

Problem is the Teleport Moonglade portion doesn't work, even when I put spell: in front of it, it basically just shows the icon but will never let me switch to it as a spell or use it. I think i'm just doing it wrong otherwise i'd submit an official bug.

function s.UpdateMacroIcon(index)
local name = format("S%03dA",index)
local button = _G[name]
if button then
local attribType = button:GetAttribute("type")
if attribType=="spell" then
SetMacroSpell(index,button:GetAttribute("spell"))
elseif attribType=="item" then
local itemID = button:GetAttribute("item")
if itemID:match("^item:") then
SetMacroItem(index,itemID)
else -- this is a toy if it's named without item:number
local _,link = GetItemInfo(itemID)
SetMacroItem(index,link)
end
elseif attribType=="macro" then
local pet = button:GetAttribute("macrotext"):match("/summonpet (.+)")
if pet then
local _,petID = C_PetJournal.FindPetIDByName(pet)
if petID then
local _,_,_,_,_,_,_,_,icon = C_PetJournal.GetPetInfoByPetID(petID)
SetMacroIcon(index,icon)
end
end
else
SetMacroSpell(index,"")
end
end
end

function s.UpdateMacroIcon(index)
local name = format("S%03dA",index)
local button = _G[name]
if button then
local attribType = button:GetAttribute("type")
if attribType=="spell" then
SetMacroSpell(index,button:GetAttribute("spell"))
elseif attribType=="item" then
local itemID = button:GetAttribute("item")
if itemID:match("^item:") then
SetMacroItem(index,itemID)
else -- this is a toy if it's named without item:number
local _,link = GetItemInfo(itemID)
SetMacroItem(index,link)
end
elseif attribType=="macro" then
local pet = button:GetAttribute("macrotext"):match("/summonpet (.+)")
if pet then
local _,petID = C_PetJournal.FindPetIDByName(pet)
if petID then
local _,_,_,_,_,_,_,_,icon = C_PetJournal.GetPetInfoByPetID(petID)
SetMacroIcon(index,icon)
end
end
else
SetMacroSpell(index,"")
end
end
end

I would like to replace buttons put to the very left and right side and would like to open the menu inwards...

Thanks!

It's been requested before. I said then it would be an all-or-nothing setting, but I think it can be done in the secure environment kinda. If a flyout is opened on the far left or far right of the screen (and not near bottom or top) it would self-organize itself to open inwards.

HI, ty for nice addon, but i have 1 problem, didnt work "type", just copy from example "/select type:Food" didnt work, for Leather, Cloth too. But with type:Quest works perfectly.
No Errors.

Out of curiosity are you on an English client?

I could see that behavior happening on non-English clients because it specifically looks for "Quest" but it uses localized returns for all the other types. So type:Lebensmittel or whatever is used, may work on deDE clients.