AccViewer can retrieve the names of Firefox browser tabs,
and so it should be possible to check if a tab
with a certain name exists,
and to click a tab with a specific name via accDoDefaultAction.
However, although I could retrieve information via AccViewer,
I have been having trouble retrieving this information via Acc.ahk.
Any help would be much appreciated, as I keep running into this problem,
with different programs, AccViewer works,
but Acc.ahk functions appear to be inconsistent,
working on some programs but not others.
The same was true of Chrome, I could retrieve information via AccViewer,
but not obtain it via the Acc functions in Acc.ahk.
To open a url in a new tab is quite straightforward:
Code: Select all
vPath := "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
Run, "%vPath%" "%vUrl%"
vPath := "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"
Run, "%vPath%" "%vUrl%"
For Firefox, initial get tab names attempt:
Code: Select all
WinGet, hWnd, ID, A
;this works
oAcc := Acc_Get("Object", "4", 0, "ahk_id " hWnd)
vOutput := ""
Loop, % oAcc.accChildCount
vOutput .= A_Index " " oAcc.accName(A_Index) "`r`n"
Clipboard := vOutput
MsgBox % vOutput
;this doesn't work
oAcc := Acc_Get("Object", "4,22", 0, "ahk_id " hWnd)
vOutput := ""
Loop, % oAcc.accChildCount
vOutput .= A_Index " " oAcc.accName(A_Index) "`r`n"
Clipboard := vOutput
MsgBox % vOutput
Return
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201