Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Checking for tabs in Firefox


  • Please log in to reply
4 replies to this topic
miningold
  • Members
  • 52 posts
  • Last active: Aug 15 2009 01:47 AM
  • Joined: 20 Nov 2008
My current code is:
^g::
Input , keystrk, I L1
IfEqual , keystrk,m		;Gmail
{
	Run , http://gmail.com/
	Return
}
IfEqual , keystrk,r		;Google Reader
{
	Run , http://google.com/reader
	Return
}
Return

What this code does is asks for ctrl +g then ask for either {m} or {r} then opens a web page depending on the key. What i want to do is check if the web page is already open in a browser, specifically firefox. When I run the command over and over again, firefox just opens a new tab each time.

What i am imagining is:

ifexist {firefox tab}
      open {firefox tab}
else 
      run gmail.com

Something along those lines

Thank you for your help

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Find any tab by name in any firefox window (fast re-find)
<!-- m -->http://www.autohotke...topic21491.html<!-- m -->

EdScriptNewbie
  • Members
  • 117 posts
  • Last active: Aug 19 2013 07:32 PM
  • Joined: 20 Jan 2007
Hi, I've been using SaaS mindmap program comapping.com (and I recommend it!). Naturally it lacks some functionality I'd like (else why would this community exist?!).

I want to write some scripts that run only if the active tab is a comapping document. The snag is, the tab title consists of only the name of the map, and doesn't mention "comapping."

For instance, go to http://go.comapping.com/comapping.html and click Welcome; you'll see a map called Welcome, in a tab entitled Welcome, and the Windows title bar says "Welcome - Mozilla Firefox". AU3_spy doesn't find any magic bullets.

The only thing I can think of is, how could I detect whether the active tab's address line starts with "http://go.comapping"? Or is there another way?

Thanks
...Ed

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
Retrieve AddressBar of Firefox through DDE Message
<!-- m -->http://www.autohotke...topic19169.html<!-- m -->

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
You can use Accessibility Standard Library.
Here is an example which was written as a sequel to IE Tab Switch.
sTitle := "Checking for tabs in Firefox"
ACC_Init()
FF_TabSwitch(sTitle)
ACC_Term()
Return

FF_TabSwitch(sTitle)
{
	DetectHiddenWindows, On
	If Not	hWnd :=	WinExist("ahk_class MozillaUIWindowClass")
	Return
	If Not	pacc := Acc_AccessibleObjectFromWindow(hWnd)
	Return
	sRole:=	acc_GetRoleText(0x14)
	Loop, %	acc_ChildCount(pacc)
		If	paccChild:=acc_Child(pacc,A_Index)
			If Not	acc_Role(paccChild)=sRole
				COM_Release(paccChild), paccChild:=0
			Else	Break
	COM_Release(pacc)
	If Not	pacc :=	paccChild
	Return
	sRole:=	acc_GetRoleText(0x3C)
	Loop, %	acc_ChildCount(pacc)
		If	paccChild:=acc_Child(pacc,A_Index)
			If Not	acc_Role(paccChild)=sRole
				COM_Release(paccChild), paccChild:=0
			Else	Break
	COM_Release(pacc)
	If Not	pacc :=	paccChild
	Return
	Loop, %	acc_ChildCount(pacc)
		If	paccChild:=acc_Child(pacc,A_Index)
			If Not	acc_Name(paccChild)=sTitle
				COM_Release(paccChild), paccChild:=0
			Else	Break
	COM_Release(pacc)
	If	paccChild
		acc_DoDefaultAction(paccChild), COM_Release(paccChild)
}