I see in the AppleScript dictionary that the current screen's worth of text and the history buffer are available as properties.
How would I AppleScript that to copy the contents of the currently selected Terminal.app tab to the paste buffer?
Could I do it on the command line?
What about the whole history log?