Select a line from a menu with the text...?
Posted: 27 Dec 2018, 05:26
How can I make my script select a specific line from a right-click menu (Chrome) based on the text on that line? Thank you.
Let's help each other out
https://www.autohotkey.com/boards/
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=60363
Code: Select all
q:: ;chrome - get url under cursor
SendInput, {Click right}
Clipboard := ""
Sleep, 30
SendInput, e ;Copy link address
ClipWait, 3
MsgBox, % Clipboard
return
;[Acc functions]
;Acc library (MSAA) and AccViewer download links - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
w:: ;chrome - get url under cursor
SendInput, {Click right}
WinWait, ahk_class Chrome_WidgetWin_2
hWnd := WinExist()
oAcc := Acc_Get("Object", "4.1.3.1", 0, "ahk_id " hWnd)
Clipboard := ""
;Sleep, 30
for _, oChild in Acc_Children(oAcc)
if (oChild.accName(0) = "Copy link address")
{
oChild.accDoDefaultAction(0)
oRect := Acc_Location(oChild)
CoordMode, Mouse, Screen
MouseGetPos, vCurX, vCurY
MouseClick,, % oRect.x+oRect.w/2, % oRect.y+oRect.h/2
MouseMove, % vCurX, % vCurY
}
oAcc := oChild := ""
ClipWait, 3
MsgBox, % Clipboard
return