Hey guys, curious if anyone knows of a way to retrieve an existing IE window/tab based on URL instead of name? I have two tabs that have the same name and PID's but different URL's. I have included Jethrow's script below for recalling windows/tabs based on the tab name. In the script I'm working on, I have stored the name of the URL in a variable, that I would like to be able to use in order to retrieve the correct IE window.
When using the last line (wb := IEGet ("") I have found that it will bring back the last active window. The issue I have with this is when attempting to send something to a control on the last active window, it doesn't send correctly because both tabs have the same name and PID.
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
If ( wb.LocationName = Name ) && InStr( wb.FullName, "iexplore.exe" )
} ;written by Jethrow
wb := IEGet("")