Sean wrote:
PS. I cahnged the Error Debugging default to On.
Thank you for this.
I’ve been having problems with Tank’s IE7_InjectJS script on one machine (work) whereas it has worked flawlessly on another (home), both running XP Pro. Initially I thought it might have been a problem with my browser ActiveX setting, as nothing was happening on my work machine. I installed the update to the COM library today and at least now I’m getting an error message:
Function Name “ parentWindow”
ERROR: Unknown Name.
(0x80020006)
The error appears to be caused by this line:
Code:
window:= COM_Invoke(COM_Invoke(pwb, "Document"), "parentWindow")
…. Called with…
Code:
F3::
list_elements2=
(
alert("This Ain't Gonna Work");
)
COM_Init()
this_page:=IE7_Get("")
msgbox this_page %this_page%
IE7_InjectJS(this_page, list_elements2)
return
here’s the complete function from Tank’s Automation Page
http://www.autohotkey.com/forum/viewtopic.php?t=30599 Code:
IE7_InjectJS(Access_Tab_Title, JS_to_Inject, VarNames_to_Return="") {
COM_Init()
Loop, % COM_Invoke(psw := COM_Invoke(COM_CreateObject("Shell.Application"), "Windows"), "Count")
{
msgbox,,,Com Initialized, 1
If (InStr(title:=COM_Invoke(pwb := COM_Invoke(psw, "Item", A_Index-1), "LocationName"), title, 0)) && (JS_to_Inject || VarNames_to_Return) {
window:= COM_Invoke(COM_Invoke(pwb, "Document"), "parentWindow")
msgbox Error?
If JS_to_Inject
COM_Invoke(window, "execScript",JS_to_Inject)
If VarNames_to_Return {
StringSplit, Vars_, VarNames_to_Return, `,
Loop, %Vars_0%
Ret .= COM_Invoke(window,Vars_%A_Index%) . ","
StringTrimRight, Ret, Ret, 1
}
COM_Release(window), COM_Release(pwb) , COM_Release(Ret ), COM_Release(title)
break
}
COM_Release(title), COM_Release(pwb)
}
COM_Release(psw), COM_Term()
Return Ret
}
COM's a bit deep for me. Any ideas?