Accessing the undo queue

Does anyone know of a way to get the undo queue into a variable in either python or MEL?
The closest thing i could find was to open a buffer file using the scriptEditor command, then referencing that as needed.
I was hoping for a more elegant solution. And by elegant, i mean faster.
There was rumor of a way to catch items that are output to the script editor, but i could not figure out a way to do this.
Anyone have any ideas?

Thanks,
Z

There was rumor of a way to catch items that are output to the script editor,

You really really dont want to do this EVER, see the text console update is SLOW yes really slow. Reading this slow pipe is even slower, and its not necceserily timely either, Nothing actually guarantees its up to date. this applies to ALL BUFFERS OF THIS KIND EVER DEVICED. even frigging 3d is a million times faster.

Does anyone know of a way to get the undo queue into a variable in either python or MEL?

yup no problem.

in mel (the reson you need to know the mel is that maya kindly tells you waht the mel command is if you ask it nicely, but it wont tell the python version on the grounds it doenst know it exists):

repeatLast -q -cnl

ergo in python:

import maya.cmds as mc
mc.repeatLast(q=True,cnl=True)

This si not exactly the same however.

Care to tell us waht you want to accomplish. instead of just stating i need this. Wich allomst certainly you odnt need.

PS; no theres no event mayas not event based.

PPS: if your looking to parse stuff form this history theres scripts done thst do this for you.