This first dialog is displayed if you click a button, or link that causes a file to get downloaded. I guess this may first dialog may or may not appear, depending on what security settings you have chosen.
This dialog appears when you try to download a file. Its basically asking the location where you want to save it.
The easiest solution is to disable the popup and download the file automatically.
Internet Explorer I thought this would do it, but I was wrong, I still get File Download popup: Tools > Internet Options > Security > select zone (example: Internet) > Security levels for this zone > Custom level... > Downloads > File download > Automatic prompting for file downloads > Disable > OK > Yes > OK.
Chrome > (Preferences... | wrench > Options) > Under the Hood > Downloads > Ask where to save each file before downloading > uncheck.
Safari on Mac does not even have the popup. On Windows: Edit > Preferences... > General > Always prompt before downloading > uncheck.
Opera > (Preferences... | Menu > Settings > Preferences...) > Advanced > Downloads > MIME Type (click one, example: audio/mp3) > Edit... > Action > Save to disk > Do not ask for folder, but save directly to > Choose... > chose folder > OK > OK.
Do not have any web page (including this one) or other app open with "File Download" in the title bar or you may get a hold of that window when, for example, calling ai.WinWait("File Download")
If testing in irb you may have to put several commands (separated with semicolons) on a single line and run them together so that all window focusing/clicking happens without losing focus to your irb window
Based on Solution 2. Modifications are addition of WinActivate and updating File Name to path+filename. Had to do this for IE8 on Win7 when saving several files to the same path (path was remembered so editing File Name to path and clicking Save had no effect).
When you use do a file save in Firefox you dont get a save as dialog. So idea is to click on the download file button and then just press enter using autoit, as what I tried, it doesn't recognizes the window..
Here is an example script for the same:
ai = WIN32OLE.new("AutoItX3.Control")
#Go to AutoIt website
#Click Download AutoIt image
#Wait for the pop-up window with the specified title supplied to come
#Always try to Activate the pop-up window before using ControlClick fn()