AutoIt with Firefox

前端 未结 6 1842
臣服心动
臣服心动 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:42

    Here you go...

    AutoItSetOption("WinTitleMatchMode", 2)
    
    $searchString = "amazon"
    
    WinActivate("Mozilla Firefox")
    For $i = 0 To 100
        Send("^" & $i)
        Sleep(250)
        If Not(StringInStr(WinGetTitle("[ACTIVE]"), $searchString) = 0) Then
            MsgBox(0, "Done", "Found it!")
            ExitLoop
        EndIf
    Next
    

    Just delete the MsgBox and you're all set!

提交回复
热议问题