Text in HTML Viewer is not copied.

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
mhcha
Junior Coder
Posts: 33
Joined: Sat Jan 01, 2022 11:10 am

Text in HTML Viewer is not copied.

Post by mhcha » Thu Sep 14, 2023 7:32 am

hello

It is possible to drag some of the text in the HTML Viewer, but it does not seem to be copied using Control+C.

I would like to drag the mouse over some text within the viewer and then bring that text to the clipboard.

GetTextInPoint in the macro scheduler works as I intended, but I keep getting memory errors, making it difficult to use.

I would appreciate it if you could suggest an alternative.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1386
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Text in HTML Viewer is not copied.

Post by Dorian (MJT support) » Thu Sep 14, 2023 8:08 am

We were recently asked about the Out of Memory errors for the GetText functions over at Support recently. This was Marcus' reply :

The GetText functions use a third party product which is no longer maintained. In any case they only work against native legacy apps and will not work with most modern apps. This is the main reason we introduced OCR - it is more portable and does not rely on the underlying architecture - does not need to go 'under the hood'. We kept the GetText functions in place for backwards compatibility reasons but their usefulness diminishes by the year. They are now around 10 years out of date and the company that provided them is no longer in business. We are unable to update them and it would not make sense to do so. The error is from the get text functions but shows Macro Scheduler because they are embedded in the macro scheduler process.
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1386
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Text in HTML Viewer is not copied.

Post by Dorian (MJT support) » Thu Sep 14, 2023 8:48 am

I'm wondering if a starting point would be to add a dialog handler for the HTMLviewer which then uses GetDialogProperty to retrieve it's contents?
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Text in HTML Viewer is not copied.

Post by Grovkillen » Thu Sep 14, 2023 8:53 am

Try this technique : viewtopic.php?f=2&t=8197#p48509
Let>ME=%Script%

Running: 15.0.27
version history

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1386
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Text in HTML Viewer is not copied.

Post by Dorian (MJT support) » Thu Sep 14, 2023 9:03 am

Grovkillen wrote:
Thu Sep 14, 2023 8:53 am
Try this technique : viewtopic.php?f=2&t=8197#p48509
Thank you for jumping in. I was still wrestling with this one after discovering GetDialogProperty doesn't actually get the property. (Then I found an old thread where you mentioned it)
Yes, we have a Custom Scripting Service. Message me or go here

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Re: Text in HTML Viewer is not copied.

Post by Grovkillen » Thu Sep 14, 2023 9:05 am

Yep, I'm always lurking around here :)
Let>ME=%Script%

Running: 15.0.27
version history

mhcha
Junior Coder
Posts: 33
Joined: Sat Jan 01, 2022 11:10 am

Re: Text in HTML Viewer is not copied.

Post by mhcha » Thu Sep 14, 2023 12:00 pm

Oh, Dear Grovkillen.
I've already read your post before writing this question.

I thought it didn't help me because I would return the same Massage for all hotspot points.

But once again, I pasted the code into my IDE and tested it, and there was a text I wanted to find in 'SRT Name_SRC' on the Watch List.

I was extracting the value of a specific page through the HttpRequest set by the cookie header that keeps the session.
And I was using that value by parsing the necessary part of HTML Viewer, but I was having a hard time putting the parsed value elsewhere.

This allowed me to extract the text and complete the program.

My repetitive work has been greatly reduced.

Thank you Dorian and Grovkillen for your help.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1386
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Text in HTML Viewer is not copied.

Post by Dorian (MJT support) » Thu Sep 14, 2023 11:04 pm

I didn't help much... Grovkillen was the guru here. Thank you though.
Yes, we have a Custom Scripting Service. Message me or go here

Jiyahana
Newbie
Posts: 10
Joined: Thu Jan 18, 2024 10:03 am
Location: India
Contact:

Re: Text in HTML Viewer is not copied.

Post by Jiyahana » Fri Feb 09, 2024 10:14 am

Hey, have you tried using JavaScript to programmatically copy the selected text from the HTML viewer to the clipboard. This can be achieved using the

Code: Select all

document.execCommand()
method in combination with the selection object.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts