much like the macrorecorder from 3dsmax:
I'd like my commands recorded and saved to a variable (preferably appended to an array).
See the Change Handlers and Callbacks chapter in 3DS Max reference. Also worth noting that unlike callbacks, what gets output to the macrorecorder stream only depends on a textual output that the plugin developer(s) decide to output and as such it's can be (and often is) wrong and/or incomplete.