WoW:API GetActionText

GetActionText - Documentation by Flickering

Get the text label for an action.

text = GetActionText(actionSlot)

Parameters

Arguments

(actionSlot)
actionSlot
Numeric - The slot number of the action to query.

Returns

text
text
String - If the action has a text label (such as macro actions), then the label is returned. nil is returned for slots with no label as well as for empty slots.

--Dekstra 12:29, 19 April 2006 (EDT)
Seems to be returning nil for slots with macros in 1.10. To reproduce the test, place any macro button in any slot, and call:

/script if (GetActionText([slot])==nil) then ChatFrame1:AddMessage("Action text in that slot is nil"); end;

Template:WoW API