如何在不打开新窗口的情况下打开网页?

问题描述:

我有一个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 

而不是使用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() 
+0

[据tumchaaditya(https://*.com/ a/10241473/3357935),您也可以使用F6将焦点切换到URL字段。 –