Select a line from a menu with the text...?
Select a line from a menu with the text...?
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.
Re: Select a line from a menu with the text...?
- Here are two variants. Both using old-school approaches, the second also using Acc.
- When I tested, accDoDefaultAction did not appear to work on the right-click menu, hence I had to use MouseClick.
- When I tested, accDoDefaultAction did not appear to work on the right-click menu, hence I had to use MouseClick.
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
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Who is online
Users browsing this forum: AHKStudent, grossermanitu, nacken012, songdg, watagan and 35 guests