Convert a firefox task to work in chrome?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
autohotkeycool
Posts: 137
Joined: 24 May 2016, 08:23

Convert a firefox task to work in chrome?

Post by autohotkeycool » 29 Jan 2022, 08:17

I'm trying to get this task to work in chrome browser, does anyone know what changes should be made to get it to work in chrome?

viewtopic.php?t=45626#p206156

Code: Select all

q:: ;Mozilla Firefox - get index of focused tab
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "4", 0, "ahk_id " hWnd)
vRet := 0
for _, oChild in Acc_Children(oAcc)
	if (oChild.accName(0) == "Browser tabs")
	{
		oAcc := Acc_Children(oChild)[1], vRet := 1
		break
	}
if !vRet
{
	oAcc := oChild := ""
	return
}

vRet := 0
for _, oChild in Acc_Children(oAcc)
{
	;STATE_SYSTEM_SELECTED := 0x2
	if (oChild.accState(0) & 0x2)
		vRet := A_Index
}
oAcc := oChild := ""
MsgBox, % vRet
return

User avatar
mikeyww
Posts: 26951
Joined: 09 Sep 2014, 18:38

Re: Convert a firefox task to work in chrome?

Post by mikeyww » 29 Jan 2022, 09:06

I would try JEE_ChromeGetFocusedTabNum. You might need to update the Acc path.

autohotkeycool
Posts: 137
Joined: 24 May 2016, 08:23

Re: Convert a firefox task to work in chrome?

Post by autohotkeycool » 29 Jan 2022, 13:41

mikeyww wrote:
29 Jan 2022, 09:06
I would try JEE_ChromeGetFocusedTabNum. You might need to update the Acc path.
thanks, does that give the actual number of the tab or just the name of the tab?

User avatar
mikeyww
Posts: 26951
Joined: 09 Sep 2014, 18:38

Re: Convert a firefox task to work in chrome?

Post by mikeyww » 29 Jan 2022, 14:29

I believe that "TabNum" refers to the tab number, but you can give it a go.

Post Reply

Return to “Ask for Help (v1)”