I need to select a specific box on a webpage, and the way I currently do it is like this:
Code: Select all
Send ^l ;Selects the address bar
Sendinput {Tab 5} ;tab to the desired control
Thanks!
Paul
Code: Select all
Send ^l ;Selects the address bar
Sendinput {Tab 5} ;tab to the desired control
Code: Select all
#Include Acc.ahk
a::
run, firefox.exe https://www.google.com
FFwait()
Send, {Tab} ; remove focus from search field for demonstrative purposes.
; the correct path in danish to rhe search field.
;pos := Acc_Get("Location", "program.gruppering2.egenskabsside6.ukendt objekt.dokument.ukendt objekt.ukendt objekt3.ukendt objekt2.ukendt objekt2.ukendt objekt.ukendt objekt.ukendt objekt.ukendt objekt.ukendt objekt.ukendt objekt3.kombinationsboks", , "ahk_class MozillaWindowClass")
; translated path may be wrong.
pos := Acc_Get("Location", "application.grupping.property_page6.unknown_object.document.unknown_object.unknown_object3.unknown_object2.unknown_object2.unknown_object.unknown_object.unknown_object.unknown_object.unknown_object.unknown_object3.combo_box", , "ahk_class MozillaWindowClass")
pos := StrSplit(pos, " ")
; adding 10 to the coordinates of the search field to ensure the click is within it.
x := SubStr(pos[1], 2) + 10, y := SubStr(pos[2], 2) + 10
ControlClick, x%x% y%y%, ahk_class MozillaWindowClass, , , , NA
ControlSend, , {Tab}, ahk_class MozillaWindowClass
return
;4,27,6,1,1,1,4,2,2,1,1,1,1,1,3,1
;"program.gruppering2.egenskabsside6.ukendt objekt.dokument.ukendt objekt.ukendt objekt3.ukendt objekt2.ukendt objekt2.ukendt objekt.ukendt objekt.ukendt objekt.ukendt objekt.ukendt objekt.ukendt objekt3.kombinationsboks"
;"application.grupping.property_page6.unknown_object.document.unknown_object.unknown_object3.unknown_object2.unknown_object2.unknown_object.unknown_object.unknown_object.unknown_object.unknown_object.unknown_object3.combo_box"
FFwait() {
loading := "Stop loading this page"
loaded := "Reload current page"
button := "application.tool_bar3.combo_box.push_button3"
;button := "program.værktøjslinje3.kombinationsboks.trykknap3"
; sleep until the description indicates page is loaded
loop {
description := Acc_Get("Name", button, 0, "ahk_class MozillaWindowClass")
OutputDebug, %description%
if(description = loaded) {
break
}
sleep, 10
}
}
Users browsing this forum: Draken, oktavimark and 338 guests