AutoHotkey Community

It is currently May 26th, 2012, 11:33 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: November 19th, 2009, 2:44 am 
Offline

Joined: November 19th, 2009, 2:34 am
Posts: 1
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 19th, 2009, 3:47 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
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
}

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 1:47 am 
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/


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 1:53 am 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
I aggree if you have some rediculous aversion to IE that iMacros is a supremely powerful tool

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Leef_me, Pulover, rbrtryn, Yahoo [Bot] and 55 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group