steveellis99 1 Posted November 6, 2011 Greetings all, After having recieved and absolute ton of assistance from all the user posts here, I feel obliged to share a bit of code I created to interact with the file-download dialog in IE. There might be better/easier ways, but I sure couldn't find them...or make them work in AutoIT as a newbie. I know there is an INetGet tool, but it won't work on the pages I'm using (security stuff...dynamic linking and my general ignorance). The code below will change the default text to a directory name, click the button, and replace the original file name back into the box. It's probably the equivalent of digital duct-tape, but I hope it can help somebody. Note: I have the destination directory stored in a variable ($dest) from a FileSelectFolder call. I'm not sure all the sleep() steps are essential, but it doesn't hurt ot have a little patience. ....after having a link clicked elsewhere in the script....snip: WinWait("File Download") WinActivate("File Download") sleep(500) ControlClick("File Download","","Button2") ; this clicks the default "save" button on the first dialog WinWait("Save As") ; Wait for the "Save As" box to pop up WinActivate("Save As") sleep(500) $filename=ControlGetText("Save As","Save &in:","Edit1") ;Get the file name before we erase it ControlSetText("Save As","Save &in:","Edit1","") ; erase the file name to make room for the $dest string sleep(1000) ControlSetText("Save As","Save &in:","Edit1", $dest) ; set the Edit1 text to the $dest and hit the button to swithc directories. ControlClick("Save As","","Button2") sleep(1000) ControlSetText("Save As","Save &in:","Edit1", $filename) ; reset the name of the file to the original value. sleep(1000) ControlClick("Save As","","Button2") 1 adarsh12in reacted to this Share this post Link to post Share on other sites
dmob 38 Posted November 7, 2011 Which version of windows? I have found that the dialogs are not the same... Share this post Link to post Share on other sites
steveellis99 1 Posted November 7, 2011 My code was created for Windows XP with IE8, but I think the basic idea would work for any version. You might have to use the AutoIT Window Info toolto get the right names for the Edit field and the buttons. The Save As dialog seems to be a Windows window (?!?!) not specifically an IE window, so I think they'll stay consistently named (I HOPE they stay consistently named!) Share this post Link to post Share on other sites
DaleHohm 65 Posted November 7, 2011 Look for solutions in my sig, below. 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