Code: Select all
$^+F12::
WinActive("A")
ControlGetFocus, my_Control
ControlGet, my_Text, Selected,, %my_Control%
MsgBox % "my_Text = " . my_Text
return
Code: Select all
$^+F12::
WinActive("A")
ControlGetFocus, my_Control
ControlGet, my_Text, Selected,, %my_Control%
MsgBox % "my_Text = " . my_Text
return
Code: Select all
F3::
ControlGet, sel, Selected,, Edit1, ahk_exe notepad.exe
MsgBox, 64, Selected text, %sel%
Return
Try it and see. Some controls might not be standard edit controls.Retrieves the selected text in an Edit control.
Code: Select all
ControlGetFocus, my_Control
MsgBox % "my_Control = " . my_Control
And it does not work in Chrome. Is there any solution? Thank you!mikeyww wrote: ↑12 Jan 2022, 01:22As far as I know, it is not an edit control, but I have not experimented much with it. You may want to try Acc. https://www.autohotkey.com/boards/viewtopic.php?t=40590
Code: Select all
F3::
clipboard := ""
Sleep 100
Send ^c
ClipWait, 1
my_Text := clipboard
MsgBox % "my_Text = " . my_Text
return