A plugin can run a utility program to copy text to the Mac or Windows clipboard:
https://community.adobe.com/t5/lightroom-classic-discussions/copy-to-clipboard/m-p/8859782
To allow the user to copy displayed text, a couple of my plugins use edit_fields() (which do allow copying). To make them read-only so the user won't accidentally change the displayed text, I use LrView.bind() and a transform function that discards the user's input.
Here's a function that makes a scrollable-text control using that approach:
local function scrolledText (args)
return f:scrolled_view {width = args.width, height = args.height,
horizontal_scroller = false,
f:edit_field {immediate = true,
height_in_lines = args.height_in_lines,
width = args.width - 12,
value = not args.readOnly and bind (args.key) or
LrView.bind {key = args.key, bind_to_object = prop,
transform = function (value, fromTable)
if fromTable then return value end
local orig = prop [args.key]
prop [args.key] = ""
prop [args.key] = orig
return orig end}}}
The magic is in the transform() function at the end.
And he's an example of invoking it:
scrolledText {key = "result", readOnly = true, width = 450, height = 100,
height_in_lines = 80}