Copy Text from Output?

Is there a way to copy text from Output to the clipboard? I’ve not found one. It would be useful for articles I’m writing.

If not … Maybe there’s some clever way to override print()?

Thanks!

If you touch the printed text, it copies to the clipboard

Alternatively, you may prefer to save your text to a blank code tab, within a pair of multi line comment tags, i.e.

--[[
everything in here
Is treated
As comments
--]]

Codea can read and write to its own code tabs.

Lookup pasteboard in the reference and see if anything there would work.

Wow didn’t realize it copies on touch, will try that. Will check on pasteboard info as well. Thanks guys

Erm. Only copies one line. Looks like overriding print may be about to happen. Or something like that …

It copies the result of one print statement. If your print output is multi line (i.e. Your print command contained line feeds) it will copy all of it, but if you make multiple print statements, then I recommend either saving it to an empty code tab, or to the hard disk using saveText (you can keep saving the cumulative text as it gets added to).

You can also save your text in a table and do a print(table.concat(tab)) and then you can select everything with one touch of the output panel.

Yes. This is using the lovely CodeaUnit from @jakesankey, so I will need to modify it a bit. No biggie. Thanks!