IEGet without arguments

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
johnegracejr
Posts: 3
Joined: 09 May 2016, 10:58

IEGet without arguments

13 Sep 2017, 11:09

I'm using IEGet (and optionally IEGetbyURL) and they work find unless I leave the parameters blank. IEGet() for instance. How do I get the most current / last active Internet Explorer window on whatever tab it happened to be on. I've also tried IEGet("") and IEGet(Name=""). I'm just trying to get the current readystate document.readystate and web.busy setting of the most current IE session. This is the code I have and the functions I include.

Code: Select all

#Include IEGet.ahk
web := IEGetURL()
wr := web.readyState
wdr := web.document.readyState
wb := web.busy
MsgBox, 0, Debugging, Web Ready - %wr%`nWeb Document Ready - %wdr%`nWeb Busy - %wb%

IEGet(Name="")                                                              ; Retrieve pointer to existing IE window/tab
{
   IfEqual, Name,, WinGetTitle, Name, ahk_class IEFrame
      Name := ( Name="New Tab - Windows Internet Explorer" ) ? "about:Tabs"
      : RegExReplace( Name, " - (Windows|Microsoft) Internet Explorer" )
   For wb in ComObjCreate( "Shell.Application" ).Windows
   {
      wbLocName := wb.LocationName
      wbFullName := wb.FullName
      If ( wb.LocationName = Name ) && InStr( wb.FullName, "iexplore.exe" )
      {
         Return wb
      } ; If
   } ; For wb
} ;written by Jethrow
Did about an hours worth of searching.
Thanks in advance.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: IEGet without arguments

13 Sep 2017, 11:18

This should do it:

Code: Select all

;[WBGet function]
;Basic Webpage Controls with JavaScript / COM - Tutorial - Tutorials - AutoHotkey Community
;https://autohotkey.com/board/topic/47052-basic-webpage-controls-with-javascript-com-tutorial/

q::
WinGet, hWnd, ID, A
oWB := WBGet()
MsgBox, % oWB.document.title "`r`n" oWB.document.url
oWB := ""
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: AlFlo, Bing [Bot], changlish76, Google [Bot], norot41087, Xeo786 and 122 guests