It is based entirely on posts/code by Jethrow. Since it took me some time to figure out how to do it even after reading Jethrow posts, I want to share this step by step guide, which might be helpful to other AHK newbies.
Big THANKS to Jethrow for Accessible Info Viewer and to Sean & Jethrow for Acc library.
(I know Jethrow abandoned Acc-Viewer in favor of UI-based tools, but it still works like a charm)
Acc Lib and Accessible Info Viewer will be needed:
http://www.autohotkey.com/board/topic/7 ... -09272012/
http://www.autohotkey.com/board/topic/7 ... 012-09-20/
Open the Viewer and drag cross on top of the browser control where all tabs are located and see if in Acc Structure you can see names of tabs.
If you see tab names there, note name of Class(NN) of that control, and "Path" / "Child ID" on the bottom of the Viewer
Here is example for K-Meleon browser:
From the Viewer, I got tab control Class(NN) "ToolbarWindow322", Path "4", Child ID - 1,2,3... {tab numbers}
Code: Select all
+z::
; get hwnd of a browser-control where all tabs are located, you can get its name from Acc Info Viewer
ControlGet, hw1, hwnd,, ToolbarWindow322, ahk_class KMeleon Browser Window
hw2 = ahk_id %hw1%
Win := Acc_ObjectFromWindow(hw1)
; get number of tabs in KM-Browser, it will be the same as accChildCount in this case
n := Win.accChildCount
Loop, %n%
tab_list .= Acc_Get("Name", "4", A_Index, hw2) "`t" Acc_Get("State", "4", A_Index, hw2) "`n"
msgbox %tab_list%
return
To activate particular tab, use this command:
Code: Select all
Win.accDoDefaultAction(A_Index) ;(inside of Loop above, where "A_Index" will be a tab number - from 1 up to %Win.accChildCount%)
To get Value/Role, replace "Name" with "Value" or "Role" etc.