 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
AEI
Joined: 19 Nov 2009 Posts: 1
|
Posted: Thu Nov 19, 2009 1:44 am Post subject: Broken Macros - TABs and IE 7 |
|
|
I wrote some macros for that use multiple tabs to navigate through and enter data on a web page. They were written when I had IE 6, and after switching to IE 7 the macros are broken. The tabs operate properly when doing keyboard input manually, but the automated sequence fails. I have tried adding some delays to slow down the process in case it was a speed issue but no luck. Generally the failure point is the sequence gets stuck in the URL Address field, but tabbing manually moves past the address field without difficulty. Has anyone else encountered this issue with tabs and IE 7?
AEI |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 2294 Location: Louisville KY USA
|
Posted: Thu Nov 19, 2009 2:47 am Post subject: |
|
|
Generally COM is the best approach or inserting JS thru the address bar
the below function will activate a tab in IE7 and 8 but requires the COM standard library
| Code: | iWeb_Activate(sTitle)
{
; thanks Sean
; http://www.autohotkey.com/forum/viewtopic.php?p=231093#231093
DllCall("LoadLibrary", "str", "oleacc.dll")
DetectHiddenWindows, On
;~ Winshow,% "ahk_id " HWND:=COM_Invoke(pwb:=iWeb_getwin(sTitle),"HWND")
;~ COM_Release(pwb)
;WinRestore,% "ahk_id " HWND
WinActivate,% "ahk_id " HWND
WinWaitActive,% "ahk_id " HWND,,5
ControlGet, hTabBand, hWnd,, TabBandClass1, ahk_class IEFrame
ControlGet, hTabUI , hWnd,, DirectUIHWND1, ahk_id %hTabBand%
If hTabUI && DllCall("oleacc\AccessibleObjectFromWindow", "Uint", hTabUI, "Uint",-4, "Uint", COM_GUID4String(IID_IAccessible,"{618736E0-3C3D-11CF-810C-00AA00389B71}"), "UintP", pacc)=0
{
Loop, % COM_Invoke(pacc, "accChildCount")
If paccChild:=COM_Invoke(pacc, "accChild", A_Index)
If COM_Invoke(paccChild, "accRole", 0) = 0x3C
{
paccTab:=paccChild
Break
}
Else COM_Release(paccChild)
COM_Release(pacc)
}
If pacc:=paccTab
{
Loop, % COM_Invoke(pacc, "accChildCount")
If paccChild:=COM_Invoke(pacc, "accChild", A_Index)
If COM_Invoke(paccChild, "accName", 0) = sTitle ; Change the condition here as appropriate!
{
COM_Release(pwb),VarSetCapacity(pwb,0),VarSetCapacity(HWND,0)
COM_Invoke(paccChild, "accDoDefaultAction", 0)
COM_Release(paccChild)
Break
}
Else COM_Release(paccChild)
COM_Release(pacc)
}
WinActivate,% sTitle
} |
_________________ Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
 |
|
| Back to top |
|
 |
TrimString Guest
|
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 2294 Location: Louisville KY USA
|
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|