Blue_Drache Posted March 28, 2007 Share Posted March 28, 2007 Ok, now I can post! The Rich Text editor's giving me trouble with FireFox. Anyway..... Javascript section that builds the controls for the website: CODE <script type="text/javascript"> var inputLUT; var searchSelect; var currentDiv; var currentInput; var currentSelection; function removeSpaces(string) { var tstring = ''; string = '' + string; splitstring = string.split(' '); for(i = 0; i < splitstring.length; i++) { tstring += splitstring; } return tstring; } function pageInitialization() { currentDiv = window.document.getElementById('targetDiv'); var stringObj = new Object(); stringObj.div = searchStringDiv; stringObj.input = window.document.getElementById('searchStrInput'); var statusObj = new Object(); statusObj.div = searchStatusDiv; statusObj.input = window.document.getElementById('searchStatInput'); var dateObj = new Object(); dateObj.div = searchDateDiv; dateObj.input = window.document.getElementById('searchDateInput'); inputLUT = new Array(); // Note: we have removed all of the spaces to reduce the chance // that changes between databases (e.g. DEV to CAL) do not effect // the matching. inputLUT['c.claim_recovery_id='] = stringObj; inputLUT['c.dcn='] = stringObj; inputLUT['m.pat_lst_namelike'] = stringObj; inputLUT['c.paid_date>'] = dateObj; inputLUT['c.paid_date<'] = dateObj; inputLUT['cr.research_status_id='] = statusObj; inputLUT['cr.last_upd_by='] = stringObj; inputLUT['cr.rfcr_date='] = dateObj; inputLUT['m.memb_recovery_id='] = stringObj; inputLUT['c.payee='] = stringObj; inputLUT['c.group_num='] = stringObj; inputLUT['c.dept='] = stringObj; searchSelect = window.document.getElementById('searchTypeSelect'); currentDiv = inputLUT[removeSpaces(searchSelect.value)].div; currentDiv.style.visibility = 'visible'; currentInput = inputLUT[removeSpaces(searchSelect.value)].input; currentInput.disabled = false; currentSelection = searchSelect.value; } // Activated when the selectField is changed. function searchFieldChanged() { var selectedDiv = inputLUT[removeSpaces(searchSelect.value)].div; var selectedInput = inputLUT[removeSpaces(searchSelect.value)].input; if(searchSelect.value != currentSelection) { currentSelection = searchSelect.value; currentDiv.style.visibility = 'hidden'; currentInput.disabled = true; currentInput.value = ''; selectedDiv.style.visibility = 'visible'; selectedInput.disabled = false; selectedInput.value = ''; currentDiv = selectedDiv; currentInput = selectedInput; } } window.onload = pageInitialization; </script> My code to attempt to interact with said controls: #include <IE.au3> Opt("TrayIconDebug", 1) ; Declare Object variables Dim $oIE, $o_fSearchValue ; Declare String variables Dim $strMSG ; Declare Integer variables Dim $intCount, $intLoop ; Declare Variants Dim $vTemp _IEAttach("FSU Detail", "Title") If @error = 7 Then ConsoleWrite("[" & @HOUR & ":" & @MIN & ":" & @SEC & "]" & "Unable to locate IE window. Error: " & @error & @LF) ;~ MsgBox(0,"", "Error locating IE window. Error: " & @error) Exit EndIf $o_fSearchValue = _IEFormGetObjByName($oIE,"searchStrInput") If @error = 7 Then ConsoleWrite("[" & @HOUR & ":" & @MIN & ":" & @SEC & "]" & "Unable to locate IE Control. Error: " & @error & @LF) ;~ MsgBox(0,"", "Error locating IE window. Error: " & @error) Exit EndIf Error returned by SciTE's console: >Running:(3.2.2.0):C:\Documents and Settings\U256655\Desktop\AutoIt\autoit3.exe "C:\Documents and Settings\U256655\Desktop\AutoIt\User Scripts\CRUAssist.au3" --> IE.au3 Error from function _IEFormGetObjByName, $_IEStatus_InvalidDataType +>AutoIT3.exe ended.rc:0 >Exit code: 0 Time: 1.735 My main question is: Am I looking in the correct place to get the control names? If not, what am I missing? How would I get the control names from the page? AutoItSpy doesn't quite work, and not sure what else to use. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
DaleHohm Posted March 28, 2007 Share Posted March 28, 2007 View Source makes the job tough when the page is dynamically generated. Suggest you examine _IEDocReadHTML or use a tool like the IE developer toolbar (see my sig) or the Firefox Dom inspector. Your most fundamental problem however is that _IEAttach("FSU Detail", "Title") needs to be $oIE = _IEAttach("FSU Detail", "Title") Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead? Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Link to comment Share on other sites More sharing options...
Blue_Drache Posted March 28, 2007 Author Share Posted March 28, 2007 *smacks forehead* Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now