ramirez 2 Posted October 17, 2010 Hi all. Searched all over but can't find the correct answer. I have a script the creates an IE page and login on it. After that it insert some data in a form. After that it submit the form and it will produce some info on a HTML table with an option to export to excel. When the script controlclick on the option to open get the excel a download window open. I've tryed a lot of code but nothing worked. Button Open WinWaitActive("File Download") Sleep(500) ControlClick("File Download", "", "[CLASS:Button; INSTANCE:1]") Button Save ControlClick("File Download", "", "[CLASS:Button; INSTANCE:2]") Sleep(500) WinWaitActive("Save As") Sleep(500) $file = ControlGetText("Save As", "", "[CLASS:Edit; INSTANCE:1]") ControlClick("Save As", "", "[CLASS:Button; INSTANCE:2]") If I stop the script and run only this lines it will work. Can someone give me a hint? Thanks in advance. Share this post Link to post Share on other sites
DaleHohm 65 Posted October 17, 2010 See my sig for a technique to automate an INPUT TYPE=FILE element. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe 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 Share this post Link to post Share on other sites
ramirez 2 Posted October 17, 2010 See my sig for a technique to automate an INPUT TYPE=FILE element. Dale Thanks for the tip Dalehohm but still no good. Add this to the script WinWait("File Download") $hChoose = WinGetHandle("File Download") ;ControlSetText($hChoose, "", "&Open", 4423, "Open") ControlClick($hChoose, "", "Button1") with or without the controlsettext. Looks like the script pauses when the window open. Share this post Link to post Share on other sites
DaleHohm 65 Posted October 18, 2010 That doesn't look anything like the example I pointed you to. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe 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 Share this post Link to post Share on other sites