API:GetActionInfo

icon_path, name, count, locked, wore, continued = GetActionInfo(slot_id);

icon_path is the path to the icon file for that slot name is the name of that slot item, it only works on macros and emotes not spells or items

edit by --Qaz1qaz1qa 02:26, 6 March 2010 (UTC)

'

slot_id:'
number 1-80 corresponding to any actionbar slot.

'Return:
' icon_path - string, path and icon used name     - string, name of macro or emote, possibly other icons, otherwise blank count    - number, of an item ei Potions locked   - boolean wore     - boolean, related to gear placed on bar. Indicated in green if true that you are wearing the item. continued - boolean

Example
for i = 1, 80 do local icon_path, name, count, locked, wore, continued  = GetActionInfo(i); if (icon_path == "interface/icons/sys_transfer.dds") then DEFAULT_CHAT_FRAME:AddMessage("found Portal on action button "..i); end; end;