AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Broken Macros - TABs and IE 7

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
AEI



Joined: 19 Nov 2009
Posts: 1

PostPosted: Thu Nov 19, 2009 1:44 am    Post subject: Broken Macros - TABs and IE 7 Reply with quote

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
View user's profile Send private message
tank



Joined: 21 Dec 2007
Posts: 2294
Location: Louisville KY USA

PostPosted: Thu Nov 19, 2009 2:47 am    Post subject: Reply with quote

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
View user's profile Send private message
TrimString
Guest





PostPosted: Fri Nov 20, 2009 12:47 am    Post subject: Reply with quote

For pure browser automation, consider using the open source iMacros for Firefox addon: https://addons.mozilla.org/en-US/firefox/addon/3863

There is also a version for Chrome. While promising, it is still too basic to get any real work done: http://www.iopus.com/imacros/chrome/
Back to top
tank



Joined: 21 Dec 2007
Posts: 2294
Location: Louisville KY USA

PostPosted: Fri Nov 20, 2009 12:53 am    Post subject: Reply with quote

I aggree if you have some rediculous aversion to IE that iMacros is a supremely powerful tool
_________________
Basic Webpage Controls with JavaScript / COM - Tutorial by Jethrow
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group