AutoIt with Firefox

neu*_*cer 5 firefox autoit

我在Firefox中打开了几个标签.我希望AutoIt激活Firefox中的特定选项卡.如何才能做到这一点?

Jea*_*dar 5

给整个浏览器窗口焦点,然后使用send命令重复发送它cntl-tab,直到窗口的标题是你想要的标签名称(最后用Mozilla Firefox).


Cop*_*pas 5

有一个名为FF.au3的UDF(用户定义函数 - 包含文件).看起来你想要的功能_FFTabSetSelected(),祝你好运!

下面是Jeanne Pindar方法的一个例子.这就是我这样做的方式.

#include <array.au3>

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
Run Code Online (Sandbox Code Playgroud)

  • FF.au3包括要求安装MozRepl,你可以在这里获取它:https://github.com/bard/mozrepl/wiki. (3认同)