How to count the number of open Firefox browser tabs?

Get help with using AutoHotkey and its commands and hotkeys
User avatar
Coldblackice
Posts: 19
Joined: 13 Nov 2013, 14:39

How to count the number of open Firefox browser tabs?

13 Nov 2013, 15:04

This might be a longshot, but would it be possible for AHK to count the number of Firefox browser tabs currently open?
Guest

Re: How to count the number of open Firefox browser tabs?

13 Nov 2013, 15:42

You could cycle through the windows/tabs and count. Probably fails when you have two tabs on the same page - here is some code you might be able to use:
http://www.autohotkey.com/board/topic/1 ... t-re-find/

Alternatively you might try with Mozrepl (=FF addon + google the AHK library for it) and some javascript http://www.benjiegillam.com/2008/09/eve ... have-open/
User avatar
Coldblackice
Posts: 19
Joined: 13 Nov 2013, 14:39

Re: How to count the number of open Firefox browser tabs?

13 Nov 2013, 17:46

Guest wrote:You could cycle through the windows/tabs and count. Probably fails when you have two tabs on the same page - here is some code you might be able to use:
http://www.autohotkey.com/board/topic/1 ... t-re-find/

Alternatively you might try with Mozrepl (=FF addon + google the AHK library for it) and some javascript http://www.benjiegillam.com/2008/09/eve ... have-open/
Thanks, much obliged for that.

I'm going to check up on the Mozrepl when I get home from work tonight, but do you think it might be possible to do this on an "OS" level, so to speak -- whether through some third party Firefox API, or perhaps "peeking" into Firefox's memory (rather than having to manually paginate through hundreds of tabs every time a count is done)?
User avatar
jethrow
Posts: 188
Joined: 30 Sep 2013, 19:52
Location: Iowa

Re: How to count the number of open Firefox browser tabs?

14 Nov 2013, 00:44

Code: Select all

list := Acc_Get("Object", "application.tool_bar3.page_tab_list", 0, "ahk_class MozillaWindowClass")
MsgBox % list.accChildCount-1
for posterity, this could be done more effectively using UIA.
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: How to count the number of open Firefox browser tabs?

15 Nov 2013, 05:04

wow! this is totally unbelievable! :ugeek: can you also create a list of each open tab "title"? :ugeek:
jethrow wrote:

Code: Select all

list := Acc_Get("Object", "application.tool_bar3.page_tab_list", 0, "ahk_class MozillaWindowClass")
MsgBox % list.accChildCount-1
for posterity, this could be done more effectively using UIA.
User avatar
jethrow
Posts: 188
Joined: 30 Sep 2013, 19:52
Location: Iowa

Re: How to count the number of open Firefox browser tabs?

17 Nov 2013, 21:07

Code: Select all

list := Acc_Get("Object", "application.tool_bar3.page_tab_list", 0, "ahk_class MozillaWindowClass")
for each, tab in Acc_Children(list)
   t .= tab.accName(0) "`n"
MsgBox %t%
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: How to count the number of open Firefox browser tabs?

17 Nov 2013, 22:02

WOW!!! totally unbelievable, thanks! :shock: :ugeek:

Return to “Ask For Help”

Who is online

Users browsing this forum: A_Birdi, Bing [Bot], Google [Bot], scriptor2016, TAC109 and 61 guests