使用多个选项卡打开 IE [英] Open IE with multiple tabs

查看:43
本文介绍了使用多个选项卡打开 IE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个可以添加到启动文件夹的 AutoHotkey 脚本,以使用多个预先确定的选项卡打开 IE.我有几个经常使用的工作网站,&我希望在加载这些页面的情况下首次登录时自动打开 IE.我已经搜索过 &找到了一些 AHK,我试图根据我的需要对其进行更改,但是我收到了错误消息.这是我尝试使用的代码:

I'm trying to create an AutoHotkey script that can be added to the Startup folder, to open IE with multiple predetermined tabs. I have several websites at work that I use regularly, & I want to have IE automatically open when I first login with these pages loaded. I've searched & found a few AHKs which I've tried to alter for my needs, but I receive errors with them. Here is the code I'm trying to use:

Pwb :=  COM_CreateObject ("InternetExplorer.Application")
Pwb.Visible:=True
Pwb.Navigate("https://*****.org/***/") 
Pwb.Navigate2("https://*****", 2048)
Pwb.Navigate3("http://*****", 2048)
Pwb.Navigate4("http://*****", 2048)
Pwb.Navigate5("*****", 2048)
Pwb.Navigate6("*****", 2048)
Return

当我启动它时,我收到错误以下变量名称包含非法字符:Pwb.Visible"程序将退出."如果我尝试删除该部分代码,则会在我的网站上收到错误消息:错误:调用不存在的函数.具体来说:Pwb.Navigate("https://.org/**/") 程序将退出."

When I launch this I receive error "The following variable name contains an illegal character: "Pwb.Visible" The program will exit." If I try to just delete that part of the code, I then get errors on my websites: "Error: Call to nonexistent function. Specifically: Pwb.Navigate("https://.org/**/") The program will exit."

推荐答案

试试这个.确保您拥有最新版本的 AutoHotkey (v1.1+).COM_CreateObject() 应该是 ComObjCreate() 并且该对象中没有 Navigate3、Navigate4 或 Navigate5... 方法可用.

Try this. Make sure you have the latest version of AutoHotkey (v1.1+). COM_CreateObject() should be ComObjCreate() and there are no Navigate3, Navigate4, or Navigate5... methods available in that object.

Pwb :=  ComObjCreate("InternetExplorer.Application")
Pwb.Visible:=True
Pwb.Navigate("http://www.google.com") 
Pwb.Navigate("http://stackoverflow.com", 2048)
Pwb.Navigate("http://news.google.com", 2048)
Pwb.Navigate("https://www.quora.com/", 2048)
Return

这篇关于使用多个选项卡打开 IE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆