Select all (JavaScript?) in HTMLViewer

Hi,

I have a HTMLViewer where I display a formatted output. If I select the text and I paste it in an RTF editor I (of course) keep the format and the style of the text. I was wondering if there’s a smart way to perform this selection programmatically and the save it to the clipboard. I think it could be done with a JS code which can be executed by the HTMLViewer…but unfortunately my JS skills are way below the threshold to accomplish this task…

Is this possible? If so, is anybody kind enough to provide me some hints on how to accomplish this?

Thanks.

http://javascriptkit.com/script/script2/selectall.shtml

The copy part is difficult to do in JavaScript, but you could use RemoteControlMBS to send Cmd-C or Ctrl-C to the window.

On Windows, you can also use [url=https://forum.xojo.com/6009-sendkey-function/0]SendKeys/url.

Thank you Michel.