yehia Posted July 14, 2009 Share Posted July 14, 2009 (edited) hi all just wasted about 2 days to write down those functions i was working on a program that have an IE object embedded and i had to go to MSDN to get some object methods and properties since there was no functions for what i wanned in the UDFs and here is a list of what i came up with in the end : _IEElementReplaceText() _IEDocMoveElement() _IEDocInsertElement() _IEPopupCreate() _IEPopupHide() _IEFrameScrollTo() _IEElementScrollIntoView() _IEGetElementFromPoint() _IEFrameSetPos() _IEBodyFindText() _IEElementSetBKColor() _IEElementSetColor() _IEWindowExists() _IECheckOnline() _IEElementSetCursor() maybe more to come but i don't think so anyway if i saw someone interested in this maybe i will create some examples please make a comment if you think this helps hope this helps all Yehia previous downloads 31 Edit: updated a function and posted the code after applying the error check systemIE New.au3 Edited July 15, 2009 by yehia My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted July 14, 2009 Moderators Share Posted July 14, 2009 There is absolutely no error checking. Link to comment Share on other sites More sharing options...
dantay9 Posted July 14, 2009 Share Posted July 14, 2009 I agree totally. For this to be added to the current autoit version, you have to error check the functions. The dev team will not do it for you. Regarding your script, some of these functions could prove potentially useful. Link to comment Share on other sites More sharing options...
Zedna Posted July 14, 2009 Share Posted July 14, 2009 Looks like good addition. Go and finish this so it can be added to standard IE UDF. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
yehia Posted July 14, 2009 Author Share Posted July 14, 2009 sure i will do it, but should i use the same error debug variables in the main IE UDFs doc or it would be ok if i created new ones? and thanks all for the responses yehia My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
dantay9 Posted July 14, 2009 Share Posted July 14, 2009 It would be best if you used the current variables in your UDF, but many people have used their own variables. I would try to use as many of the current variables as you can without changing how they work. If you need to create another variable to check for another error, do that. It is better to have more variables and error checking than no error checking at all. Link to comment Share on other sites More sharing options...
yehia Posted July 15, 2009 Author Share Posted July 15, 2009 ok added error check to my functions using the same error flags that was used on the old IE functions and examples r coming ... My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
techbard Posted July 15, 2009 Share Posted July 15, 2009 Hey... Nice Works!!! I'll try it. Link to comment Share on other sites More sharing options...
bo8ster Posted July 15, 2009 Share Posted July 15, 2009 Good work there. I recommend you get DaleHohm to look at them. If he is happy with them you have a change to get them added. 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...
LOULOU Posted July 15, 2009 Share Posted July 15, 2009 Hi, Have you an idea on How to automate Input type=file with IE8, Dale find a solution for IE 7 or IE6 but this solution is not applicable with IE8 because of security prevention. Thanks Link to comment Share on other sites More sharing options...
yehia Posted July 15, 2009 Author Share Posted July 15, 2009 (edited) thanks all @ LOULOU r u talking about the value property? if so i have IE 8 beta and it works, u can manipulate the value anyway to test this the property is named value so all u have to do is get an element then $element.value = "your value string" and i guess there is another way through textrange elements but so far i only managed to use body text elements only Edit: oh and one more way you can set the mode of IE8 to work under a lower version mode like IE7 and 6 Edited July 15, 2009 by yehia My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
LOULOU Posted July 15, 2009 Share Posted July 15, 2009 thanks all@ LOULOU r u talking about the value property?if so i have IE 8 beta and it works, u can manipulate the valueanyway to test this the property is named value so all u have to do is get an element then $element.value = "your value string"and i guess there is another way through textrange elements but so far i only managed to use body text elements onlyEdit: oh and one more way you can set the mode of IE8 to work under a lower version mode like IE7 and 6Try to automate an Input type = file , and try to assign a value in the texte zone where you chose the name of the file , and you will see it is impossible due to security restriction, what i find is a way to bypass this problem Link to comment Share on other sites More sharing options...
yehia Posted July 15, 2009 Author Share Posted July 15, 2009 yes LOULOU change the mode to any previous version and there will be nomore security restrictiononce more thats right from MSDNhttp://msdn.microsoft.com/en-us/library/ms535128(VS.85).aspxInternet Explorer 8 and later. When a file is selected by using the input type=file object, the value of the value property depends on the value of the "Include local directory path when uploading files to a server" security setting for the security zone used to display the Web page containing the input object.The fully qualified filename of the selected file is returned only when this setting is enabled. When the setting is disabled, Internet Explorer 8 replaces the local drive and directory path with the string C:\fakepath\ in order to prevent inappropriate information disclosure.To illustrate, suppose you attempt to upload a file named C:\users\contoso\documents\file.txt. When you do this, the value of the value property is set to c:\fakepath\file.txt. My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine Link to comment Share on other sites More sharing options...
Michel Claveau Posted July 15, 2009 Share Posted July 15, 2009 (edited) Hi, Loulou ! an idea on How to automate Input type=file with IE8? Cet exemple de code fonctionne (pour moi):$ie = ObjCreate("InternetExplorer.Application") $ie.Navigate("file: ///L:/miniedit_tst3.htm") $ie.Visible=1 Sleep(1024) ;wait for full load inputfile('champinput','C:\fichier.dat') Exit Func inputfile($id,$filename) $ie.Navigate("javascript: document.getElementById('"& $id &"').click();") Sleep(1024) ;wait depend of computer's speed Send($filename) ;Sleep(1024) ;wait only for user see the filename sended Send("{ENTER}") EndFunc Ne pas oublier de changer l'URL, ni de mettre le bon ID de l'input, et de choisir un nom de fichier existant. Edited July 15, 2009 by Michel Claveau Link to comment Share on other sites More sharing options...
DaleHohm Posted July 15, 2009 Share Posted July 15, 2009 In IE8, the input type=file text box is read-only. You can't even type into it with the keyboard. They long ago disabled the ability to set the value with script. You need to click on the associated "Browse..." button and automate filling in the file selection popup box with standard Win* functions. 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...
gooker Posted July 16, 2009 Share Posted July 16, 2009 useful ,ths Link to comment Share on other sites More sharing options...
Michel Claveau Posted July 16, 2009 Share Posted July 16, 2009 Hi!In IE8, the input type=file text box is read-only. You can't even type into it with the keyboard. They long ago disabled the ability to set the value with script. You need to click on the associated "Browse..." button and automate filling in the file selection popup box with standard Win* functions.You are right. But, if you want use the Autoit's IE-library (#include <IE.au3>), it not will run. Because _IEAction($inputobj, "click") wait the end of the dialog box.My exemple of code run ok, but because it do not wait, after the click. Link to comment Share on other sites More sharing options...
DaleHohm Posted July 16, 2009 Share Posted July 16, 2009 In IE8, the input type=file text box is read-only. You can't even type into it with the keyboard. They long ago disabled the ability to set the value with script. You need to click on the associated "Browse..." button and automate filling in the file selection popup box with standard Win* functions. Dale Like this: #include <IE.au3> $oIE = _IE_Example("form") $oT = _IEGetObjById($oIE, 'fileExample') MouseMove(_IEPropertyGet($oT, "screenx") + _IEPropertyGet($oT, "width") - 10, _ _IEPropertyGet($oT, "screeny") + _IEPropertyGet($oT, "height")/2) MouseClick("left") WinWait("Choose File to Upload") $hChoose = WinGetHandle("Choose File to Upload") ControlSend($hChoose, "", "Edit1", "C:\AUTOEXEC.BAT") ControlClick($hChoose, "", "Button2") 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 July 16, 2009 Share Posted July 16, 2009 Instead of ControlSend($hChoose, "", "Edit1", "C:\AUTOEXEC.BAT") is better ControlSetText($hChoose, "", "Edit1", "C:\AUTOEXEC.BAT") especially for non English enviroments with special accented characters in path Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
yehia Posted July 17, 2009 Author Share Posted July 17, 2009 dalehohm its nice to see you here and thanks for your replies can you take a look on the error checking in the functions to tell me if i did it right? thanks alot and 1 week for examples My Scripts:IE New UDFsElastic images moving under mouse (with a happy valentine's example)_FileRemoveLine 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