mark2004 Posted April 25, 2010 Share Posted April 25, 2010 I have the need to script applications that have embedded Internet Explorer_server classes. Since these apps are not run in a standard Internet Explorer window, I can't access the many tools such as DebugBar or the developer toolbar. A good example would be the Autoit Help window. Most of the information is within a Internet Explorer_Server class. Could someone show me how I could get access to the DOM of the Autoit Help window. I could probably figure it out for my other applications if I saw how to do the Autoit Help window. Thanks. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 26, 2010 Share Posted April 26, 2010 Get a reference to the embedded instance with _IEAttach(), using the "embedded" mode: #include <IE.au3> $hHelp = WinGetHandle("[CLASS:HH Parent; TITLE:AutoIt Help]", "") ConsoleWrite("$hHelp = " & $hHelp & @LF) $oIE = _IEAttach($hHelp, "embedded") If IsObj($oIE) Then $sHTML = _IEBodyReadHTML($oIE) ConsoleWrite("sHTML = " & $sHTML & @LF) Else ConsoleWrite("Error attaching to IE") EndIf Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
DaleHohm Posted April 26, 2010 Share Posted April 26, 2010 Also note that DebugBar puts an icon in the toolbar that looks like an eye. This allows you to "Spy on other IE instances". This will allow you to use the DebugBar functionality on any such windows, embedded or not. 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...
mark2004 Posted April 27, 2010 Author Share Posted April 27, 2010 It is not the attaching part that I am concerned about. It is the inspecting part. Tools like debug bar etc are so handy for scripting. In fact, I don't really know how I'd script IE applications without these tools. _IEAttach() by itself doesn't really allow me to see what elements I want to interact with. I should have mentioned that I tried using the little eyeball in debug bar on the Autoit Help Application (as a test). It lists "AutoIt Help" as another instance of IE but it isn't able to pull anything into its little window. So, that was no help. I would love to be able to use one of these tools to visualize all the element information of an embedded IE instance. Any further suggestions?? Link to comment Share on other sites More sharing options...
mark2004 Posted April 27, 2010 Author Share Posted April 27, 2010 Actually, I just modified Psalty's code a little to copy the source to the clipboard and then I pasted that into my own html file and opened that with IE. Then I was able to use the DebugBar on it. I guess that will work if that is my only option. But, if anyone knows of a more direct way to do this I'm all ears.... Link to comment Share on other sites More sharing options...
DaleHohm Posted April 27, 2010 Share Posted April 27, 2010 DebugBar works for me on the AutoIt help window, just as i suggested. Just click the triangle next to the app you want and then click on <MAIN DOCUMENT>. You can also then click the green arrow to tell it to open the url in a new IE window. 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...
mark2004 Posted April 28, 2010 Author Share Posted April 28, 2010 I got DebugBar to work fine on my desktop PC with XP Pro and IE 6.0. It does exactly what you said. However, my laptop with Vista SP2 and IE 7 doesn't do so well. DebugBar doesn't show a triangle next to the AutoitHelp entry in the window spy window. And it can't load any source or go to a URL (the url field is blank). Not sure what is going on there. I may try to update to IE 8 to see if that fixes it. Link to comment Share on other sites More sharing options...
PsaltyDS Posted April 28, 2010 Share Posted April 28, 2010 Running DebugBar 5.4.1 on Vista Busi 32-bit with IE8: Clicked on the "eye" icon for "Spy other IE instances", then selected AutoIt Help in the pop-up. No joy. Of course this is a DebugBar issue, not AutoIt's, but I do see the problem. Suggest checking out the DebugBar web site for support and possible work-around. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
DaleHohm Posted April 28, 2010 Share Posted April 28, 2010 Odd. I am running Windows 7 and Windows XP and IE8 and tried both DebugBar V5.4 and V5.4.1 and all worked as I described. I avoided Vista... perhaps you should too ;-) 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...
PsaltyDS Posted April 28, 2010 Share Posted April 28, 2010 I avoided Vista... perhaps you should too ;-)I ordered these boxes with Win7 64-bit. Some dweeby grey-skinned poxy supply droid changed them to Vista without asking. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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