LoginSignup
0
0

More than 5 years have passed since last update.

外部プログラムからIE11をタブで開く【AutoHotkey+vbs】

Last updated at Posted at 2015-06-27

手順

①下記コードをコピペしieopen.vbsを作成する。
 このサイトのコードを参考。

ieopen.vbs
Set Shell=CreateObject("Shell.Application")
For k=Shell.Windows().Count-1 To 0 Step -1
  Set ie=Shell.Windows().Item(k)
  If LCase(Right(ie.FullName,13))="\iexplore.exe" Then Exit For
Next
If ie = "エクスプローラー" Then
  Set ie=CreateObject("InternetExplorer.Application")
  ie.Visible=True
  ie.Navigate2 WScript.Arguments.Item(0)
Else
  ie.Navigate2 WScript.Arguments.Item(0),&H800
End If

②Runコマンドで①のファイルとURLを指定

AutoHotkey.ahk
Run, C:\**\ieopen.vbs "%OutputVar%"

補足

・①のコードもAutoHotkeyで書くならWinGetなどで現在、開いているIEのインスタンスを取得してなんらかをSendすれば良いか?
 以下のようなコマンドラインオプションだと新規で窓が開いてしまい、タブでは開けないようだ。

 Run, ***\iexplore.exe -e "URL"
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0