jayyx Posted December 18, 2013 Share Posted December 18, 2013 I will start by saying I'm no expert and my code is sloppy. However, I was able to accomplish what I needed. Here is my problem... ;Local $oFrame = _IEFrameGetCollection($oIE, 1) ;Local $oForm = _IEFormGetObjByName($oFrame, "DlgAddWorkspace") That code works to grab my objects on one system, but on another system the frame index number changes -- so it can not successfully grab the $oForm object. I have been trying to figure out the best way to loop through the entire _IEFrameGetCollection looking for the Form 'DlgAddWorkspace' but I have not been able to do so thus far. I need a little guidance or the best approach for this. This doesn't work but I tried something along the lines of a loop within a loop: Do Local $oFrames = _IEFrameGetCollection($oIE) Local $iNumFrames = @extended For $i = 0 To ($iNumFrames - 1) Local $oFrame = _IEFrameGetCollection($oIE, $i) Local $oForm = _IEFormGetObjByName($oFrame, "DlgAddWorkspace") Next If isObj($oForm) Then $i = $iNumFrames EndIf Until isObj($oForm) Any guidance would be much appreciated. Thanks! Link to comment Share on other sites More sharing options...
jayyx Posted December 18, 2013 Author Share Posted December 18, 2013 I found a method that works but isn't fool proof...any suggestions for improvements would be much appreciated! $FrameCount = 1 Local $oFrame = _IEFrameGetCollection($oIE, $FrameCount) Local $oFormCollection = _IEFormGetCollection($oFrame) If @extended > 0 Then Local $oForm = _IEGetObjByName($oFrame, "DlgAddWorkspace") Else $FrameCount = $FrameCount + 1 Local $oFrame = _IEFrameGetCollection($oIE, $FrameCount) Local $oFormCollection = _IEFormGetCollection($oFrame) If @extended > 0 Then Local $oForm = _IEGetObjByName($oFrame, "DlgAddWorkspace") Else $FrameCount = $FrameCount + 1 Local $oFrame = _IEFrameGetCollection($oIE, $FrameCount) Local $oFormCollection = _IEFormGetCollection($oFrame) If @extended > 0 Then Local $oForm = _IEGetObjByName($oFrame, "DlgAddWorkspace") EndIf EndIf EndIf Link to comment Share on other sites More sharing options...
Solution jayyx Posted December 18, 2013 Author Solution Share Posted December 18, 2013 (edited) I think I've ended up answering my own question in the end, but will post here for anyone who may have the same problem... Do Local $FrameCount = $framecount + 1 Local $oFrame = _IEFrameGetCollection($oIE, $FrameCount) Sleep(200) Local $oForm = _IEFormGetObjByName($oFrame, "DlgAddWorkspace") Sleep(200) Until isObj ($oForm) I am still open to suggestions for a better way to go about this.. Edited December 18, 2013 by jayyx JohnOne 1 Link to comment Share on other sites More sharing options...
JohnOne Posted December 18, 2013 Share Posted December 18, 2013 Perfect example of how writing your code for someone else to read, can easily wind up being self educational. Thanks. jayyx 1 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. 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