I need some guidance on how to best use the IE.au3 to do the following task. I have a gui built and ready to go, I just need to finish the COM coding.
Here is the code that I have so far.
#include <GUIConstants.au3> #include <IE.au3> GUICreate("Drivers/Manuals/Warranty", 280, 110) $Driver = GUICtrlCreateCheckbox("Drivers", 10, 10) GUICtrlSetState(-1, $GUI_CHECKED) $Manual = GUICtrlCreateCheckbox("Manual", 80, 10) $Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10) GUICtrlCreateLabel("Service Tag #:", 10, 45) $Input = GUICtrlCreateInput("", 90, 40) $Submit = GUICtrlCreateButton("Submit", 40, 70, 50) $Exit = GUICtrlCreateButton("Cancel", 150, 70, 50) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Submit $serv_tag = GUICtrlRead($Input) If IsChecked($Driver) Then _Fire($serv_tag) Case $msg = $Exit ExitLoop EndSelect WEnd Exit 0 Func _Fire($sServiceTag) $oIE = _IECreate("http://www.dell.com/support/drivers/us/en/04/DriversHome/NeedProductSelection",1 ,1 ,0) _IELoadWait($oIE) EndFunc Func _Fire2($sServiceTag) $oIE = _IECreate("" & $sServiceTag, 1, 1, 0) Func IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFunc
When it navigates to the http://www.dell.com/support/drivers/us/en/04/DriversHome/NeedProductSelection URL we need to have the service tag box populated with the service tag that the user inputs. I have this working with AutoHotKey but I'm converting some scripts from AHK to AU3 and understand that the same COM commands will not work.
AHK Code
url = http://www.dell.com/support/drivers/us/en/04/DriversHome/NeedProductSelection pwb := ComObjCreate("InternetExplorer.Application") ;navigates to the url pwb.Navigate(url) pwb.visible := true While ((pwb.readyState <> 4) || pwb.busy) ;Sleep, 10 frame := pwb.document.all["iFramePSHost"].contentWindow frame.document.all["TheProductSelectorResultsModel_ServiceTagCode"].value := Tag frame.document.all.btnSubmit[0].click()
So far I have replicated the code up until the frame start. I am able to navigate to the page and have it wait for it to load. Now I just need some help with using the right IE commands to complete the task of inserting the service tag and clicking submit.
Edited by Crazyace, 01 May 2012 - 11:50 AM.




