AutoIt with Firefox

前端 未结 6 1785
臣服心动
臣服心动 2021-02-04 19:58

I have several tabs open in Firefox. I want AutoIt to activate a particular tab in Firefox. How can this be done?

6条回答
  •  北荒
    北荒 (楼主)
    2021-02-04 20:38

    There's a UDF (User Defined Functions -include file) called FF.au3. Looks like the function you want is _FFTabSetSelected(), good luck!

    Below is an example of Jeanne Pindar's method. This is the way I would do it.

    #include 
    
    Opt("WinTitleMatchMode", 2)
    
    activateTab("Gmail")
    Func activateTab($targetWindowKeyphrase)
        WinActivate("- Mozilla Firefox")
        For $i = 0 To 100
            If StringInStr(WinGetTitle(WinActive("")),$targetWindowKeyphrase) Then
                MsgBox(0,"Found It", "The tab with the key phrase " & $targetWindowKeyphrase & " is now active.")
                Return
            EndIf
            Send("^{TAB}")
            Sleep(200)
        Next
    EndFunc
    

提交回复
热议问题