Code: Select all
#Requires Autohotkey v2.0+
#Include <UIA_Interface-v2>
#Include <UIA_Browser-v2>
RunWait "https://www.amazon.com/"
WinWaitActive "Amazon ahk_exe chrome.exe"
cUIA := UIA_Browser("Amazon ahk_exe chrome.exe")
helloPos := cUIA.WaitElement({AutomationId:"nav-link-accountList"}).GetPos()
MouseMove(helloPos.x+helloPos.w//2, helloPos.y+helloPos.h//2)
cUIA.WaitElement({Name:"Sign in", Type:"Link"}).Highlight()
Code: Select all
cUIA.WaitElement({AutomationId:"nav-link-accountList"})
cUIA.JSExecute("document.querySelector('#nav-link-accountList').dispatchEvent(new Event('mouseover'));")
cUIA.WaitElement({Name:"Sign in", Type:"Link"}).Highlight()