Zedna Posted June 20, 2011 Share Posted June 20, 2011 (edited) Here is small reproducing script: #include <IE.au3> ShellExecute('www.google.com') WinWait("Microsoft Internet Explorer") $oIE = _IEAttach("Microsoft Internet Explorer") If @error Then MsgBox(0,'_IEAttach error', @error) It always show messagebox with @error=7 (No Match) I tested sources of _IEAttach() and there is problem with $o_window.document.title which returns empty string $o_window.type returns 'Dokument HTML' So this condition is false and this is source of problem If StringInStr($o_window.document.title, $s_string) > 0 Then EDIT: On Win7 must be used titile Windows Internet Explorer EDIT2: In fact I test it on IE window opened by hand without ShellExecute() + WinWait() Edited June 20, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Juvigy Posted June 20, 2011 Share Posted June 20, 2011 Hi Zedna, What version of IE do you have ? Did you try attaching with 'url' as param? It works for me on Vista and IE7. This is what i tested: ShellExecute('www.google.com') WinWait("Google") $oIE = _IEAttach("Google") If @error Then MsgBox(0,'_IEAttach error', @error) Link to comment Share on other sites More sharing options...
Zedna Posted June 20, 2011 Author Share Posted June 20, 2011 (edited) Hi Zedna,What version of IE do you have ?As I said in Title/description: tested on WinXP/IE6 and Win7/IE9 Edited June 20, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted June 20, 2011 Author Share Posted June 20, 2011 [autoit]$oIE = _IEAttach("Google") This really works for me too!! I will do some more tests... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted June 20, 2011 Author Share Posted June 20, 2011 I think it can be because there is IE object used in another application (as embedded object) for example Outlook or maybe also Word and this instance of IE has empty title. _IEAttach has implicit $i_instance = 1 parameter so if first IE has empty title then it probably stop searching other ones. I will do some more tests if that;s the case... Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
DaleHohm Posted June 20, 2011 Share Posted June 20, 2011 @Zedna - _IEAttach, by default looks for the "Document Title". In your case, this is "Google", not "Microsoft Internet Explorer". "Microsoft Internet Explorer" is appended to the document title to create the Window Title (note - that string changes based on the version of IE, so be careful). 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...
Zedna Posted June 20, 2011 Author Share Posted June 20, 2011 (edited) @Zedna - _IEAttach, by default looks for the "Document Title". In your case, this is "Google", not "Microsoft Internet Explorer". "Microsoft Internet Explorer" is appended to the document title to create the Window Title (note - that string changes based on the version of IE, so be careful).DaleOK. That's probably source of my problems.I made renamed local copy of _IEAttach() and added some ConsoleWrite() to see where it's going and what are some values.I was confused because $o_window.document.title was empty string.Tommorow I will do some more tests to see if it will work with Title without " - Microsoft Internet Explorer"Thanks to all for help! Edited June 20, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted June 27, 2011 Author Share Posted June 27, 2011 (edited) OK. That's probably source of my problems. I made renamed local copy of _IEAttach() and added some ConsoleWrite() to see where it's going and what are some values. I was confused because $o_window.document.title was empty string. I discovered there is really $o_window.document.title empty when you have opened about:blank page in IE In this case you can use workaround with HWND $oIE = _IEAttach("Some title") If @error Then MsgBox(0,'_IEAttach error', @error) ; error=7 $hwnd = WinGetHandle("Some title") $oIE = _IEAttach($hwnd, "HWND") If @error Then MsgBox(0,'_IEAttach error', @error) ; OK Edited June 27, 2011 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search 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