【问题标题】:How do I open a webpage without opening a new window?如何在不打开新窗口的情况下打开网页?
【发布时间】:2017-08-07 21:56:26
【问题描述】:

我有一个 AutoHotkey 脚本,它通过 URL 导航网站上的各个页面。每次我想打开一个新页面时,我都会使用Run 命令,它会打开一个新的 Internet Explorer 实例。

当我的脚本完成运行时,我通常会打开 5 或 6 个不同的窗口来浏览网站。

如何在 Autohotkey 中打开网页而不创建新窗口?

^j::
  Run, iexplore.exe www.example.com/login, , Max
  doStuff1()
  Run, iexplore.exe www.example.com/settings, , Max
  doStuff2()
  Run, iexplore.exe www.example.com/wp-admin, , Max
  doStuff3()
  // doStuff4(), doStuff5(), etc.
return

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    除了使用Run 命令,您可以Send 更改 URL 所需的击键(或者如果您愿意,可以打开一个新选项卡)。

    在您确认您的iexplore.exe 已启动后:

    WinGetActiveTitle, Curwtt               ; Get title of active window
    

    当您准备好更改网址时:

    WinActivate, %Curwtt%                   ; Ensure we are on original window
    Send, !d                                ; Alt-D places cursor in URL field
    Send, http://blahblahblah.com{Enter}    ; Go to the new web site
    ; Dostuff()
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-06-26
    • 2020-10-27
    • 1970-01-01
    • 2017-10-29
    • 1970-01-01
    • 2011-05-15
    • 2021-08-22
    • 1970-01-01
    相关资源
    最近更新 更多