ScripteEditor: grabbing selected txt via "cmdScrollFieldReporter"

Not sure you can even grab this in code but I’m trying to get back the selected text from the scriptEditor History / Reporter. I’m doing some hackery so that you can select text in the editors and on the popupMenu run an autoInspect that will allow you to go straight to debugging that function it in the editor of your choice.
After a lot of poking around I’ve found the main calls but there doesn’t seem to be a way to return the selected text from the history, just from the editor portion of the scriptEditot. I know you can copy the selected txt, but I want the selected text returned so I can pass it into my function.

Any ideas??

Ta

Are you trying to copy text from the cmdScrollFieldExecuter, or the cmdScrollFieldReporter?

If it’s the reporter, I think the only way is going to be to copy the selected text, and then use ctypes/win32api or PyQt/PySide to query the clipboard and restore the original clipboard afterwards.
(ctypes is more complicated, but there’s plenty of examples with complete code for get/set clipboard)

Another easy way would be to convert the scroll reporter to a QTextField and then just use that to query selected text.

edit
Here’s a ctypes class for the clipboard:
http://code.google.com/p/pylib/source/browse/trunk/lib3/lib/clipboard.py?spec=svn27&r=27

Yeah that’s pretty much the conclusion I’d come to, trying to get it from the Reporter

cheers