Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get the last message in Google Chrome browser
#16
Difficult to find the button element reliably with elm. No name etc; the UI element tree is different in different ChatGPT states. Even key End does not work.

This script uses another way. At first scrolls to the first element below text (the Copy button probably is in that row). Then uses uiimage.
 
Code:
Copy      Help
print.clear();

var w = wnd.find(0, "*Google Chrome", "Chrome_WidgetWin_1");

//scroll to the first element after the text
var e = w.Elm["web:GROUPING", prop: "@data-message-author-role=assistant", navig: "ne"].Find(1);
e.ScrollTo();

clipboard.clear();

string image = @"image:";
var im = uiimage.find(3, w, image, IFFlags.PrintWindow);
im.MouseClick();
mouse.moveBy(0, -50);

var s = wait.until(3, () => clipboard.text);
print.it(s);

Recapture the Copy button image.


Messages In This Thread
RE: How to get the last message in Google Chrome browser - by Gintaras - 03-29-2024, 11:01 AM

Forum Jump:


Users browsing this thread: 11 Guest(s)