The 1st block of code works but the second doesn't and gives an error message saying "Internet Explorer cannot download".
Does anyone know how to get the second block of code to work, i.e. is there a way to navigate straight to javascript from a new instance of ie, rather than having to use an existing instance.
Thanks.
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 Pwb in ComObjCreate( "Shell.Application" ).Windows
If ( Pwb.LocationName = Name ) && InStr( Pwb.FullName, "iexplore.exe" )
Return Pwb
} ;written by Jethrow
ie := ComObjCreate("InternetExplorer.Application")
ie.Visible := true
ie.Navigate("www.google.co.uk")
While ie.readystate <> 4
sleep 50
Pwb := IEGet() ;Tab name you define can also be a variable
Pwb.Navigate("javascript:newWin=window.open('http://www.autohotkey.com', 'newwin', 'width=500, height=500, toolbar=0, resizable=0, location=0, menubar=0, scrollbars=0'); newWin.focus();")
ie := ComObjCreate("InternetExplorer.Application")
ie.Visible := true
ie.Navigate("javascript:newWin=window.open('http://www.autohotkey.com', 'newwin', 'width=500, height=500, toolbar=0, resizable=0, location=0, menubar=0, scrollbars=0'); newWin.focus();")
While ie.readystate <> 4
sleep 50




