Olsson Posted December 22, 2008 Share Posted December 22, 2008 Hi, I have been looking around and trying to understand how I can make a window containing IE object, and in this window - click. I want it to click and handle itself, within this window, without disturbing me, when I'm using the computer. Any code examples or special functions I should look at? I would love to get some help with this! Thanks, Olsson Link to comment Share on other sites More sharing options...
Skruge Posted December 22, 2008 Share Posted December 22, 2008 Hi, This is possible with the IE Library. Consult the help file for the _IE* functions. This code generates a page that links to useful references and tools.#include <IE.au3> $oIE = _IE_Introduction ("basic") [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font] Link to comment Share on other sites More sharing options...
bo8ster Posted December 22, 2008 Share Posted December 22, 2008 The IE Library has what you need. Search the forums, it has loads of examples of simple and complex operations. Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
Olsson Posted December 23, 2008 Author Share Posted December 23, 2008 Thank you for the replies! I'm stuck at the same error as I've been on previously; While using StringInStr() I get the following error: Return $o_object.document.body.innerText Return $o_object.document^ ERROR G:\Program\AutoIt3\Include\IE.au3 (2241) : ==> Variable must be of type "Object".: Using $oIE = ObjCreate("Shell.Explorer.2") Link to comment Share on other sites More sharing options...
BrettF Posted December 23, 2008 Share Posted December 23, 2008 Just use the _IE* functions. You will find them in the helpfile. Cheers, Brett Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Olsson Posted December 27, 2008 Author Share Posted December 27, 2008 (edited) Well, I might just be stupid, but I can't find what I'm looking for =/ #include <IE.au3> #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 900, 580, 192, 114) GUISetBkColor(0xFFFFFF) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $oIE = ObjCreate("Shell.Explorer.2") GUICtrlCreateObj($oIE, 169, 1, 730, 580) $oIE.navigate("google.com") ;~ $oIE = _IE_Example ("basic") $oLink = _IEGetObjByName ($oIE, "AutoItImage") _IEAction ($oLink, "click") _IELoadWait ($oIE) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd gives me: >"G:\Program\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "G:\Program\AutoIt3\Examples\Olsson\asd.au3" G:\Program\AutoIt3\Include\IE.au3 (2709) : ==> Variable must be of type "Object".: If IsObj($o_object.document.GetElementsByName($s_Id).item($i_index)) Then If IsObj($o_object.document^ ERROR >Exit code: 1 Time: 0.307 I figured out my own stupid mistake. Thanks anyways. (You have to declare the object; GUICtrlCreateObj($oIE, 169, 1, 730, 580) Edited December 27, 2008 by Olsson Link to comment Share on other sites More sharing options...
DaleHohm Posted December 27, 2008 Share Posted December 27, 2008 (edited) Using more of the _IE functions will help you here. You are trying to access elements on the page before it is loaded. _IENavigate takes care of that for you (by implicitly calling _IELoadWait). Try this: #include <IE.au3> #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 900, 580, 192, 114) GUISetBkColor(0xFFFFFF) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $oIE = _IECreateEmbedded() GUICtrlCreateObj($oIE, 169, 1, 730, 580) _IENavigate($oIE, "google.com") After that you will get warnings in your code because there is not element with an ID of AutoItImage on the page. Dale Edited December 27, 2008 by DaleHohm 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...
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