03-29-2024, 11:01 AM
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.
Recapture the Copy button image.
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.
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.