Jump to content

Recommended Posts

Posted

Hi,

I am trying to automate a "Download File" and then "Save as" from IE8 without success.

The script gets to the point where the "Download File" windows pops up but then nothing happens.

Any help will be much appreciated. Here is my script:

#include <IE.au3>

$oIE = _IECreate ("http://127.0.0.1/my_site")

_IENavigate ($oIE, "http://127.0.0.1/my_site/download.asp?date=11_2010")

WinWait("File Download","Do you want to open or save th")

ControlClick("File Download","Do you want to open or save this file","Button2")

WinWait("Save As","Save &in:")

ControlClick("Save As","Save &in:","Button2")

WinWait("Save As","C:\10490001_11_2010.zip alread")

ControlClick("Save As","C:\10490001_11_2010.zip alread","Button1")

WinWait("Download complete","Download Complete")

ControlClick("Download complete","Download Complete","Button4")

Thanks in advance,

Alma

Posted

Are you certain "Button2" is a valid control ID?

It is valid ClassNN format. Could have been done as "[CLASS:Button; INSTANCE:2]".

Because downloading files can bring in malware, some small measure of extra protection has been added to IE in those file handling dialogs. They seem to block some synthetic inputs.

It can often still be done by giving focus to the button and sending "{ENTER}".

:graduated:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

It is valid ClassNN format. Could have been done as "[CLASS:Button; INSTANCE:2]".

Because downloading files can bring in malware, some small measure of extra protection has been added to IE in those file handling dialogs. They seem to block some synthetic inputs.

It can often still be done by giving focus to the button and sending "{ENTER}".

:graduated:

Thank you. Since I am a newbie, can you please write me back exactly how to give focus and then send the {ENTER}?

Thanks, Alma

Posted

WinActivate and Send.

Hi Bruce,

Tried it and it didn't help. The "Download File" window is there forever...any other idea?

Thanks, Alma

Posted (edited)

Hi Bruce,

Tried it and it didn't help. The "Download File" window is there forever...any other idea?

Thanks, Alma

If you can't get it to work, as you know the download url, may be you could download it with inetget ...

Edited by wakillon

AutoIt 3.3.18.0 X86 - SciTE 5.5.7WIN 11 24H2 X64 - Other Examples Scripts

Posted

Hi,

just found out the problem: I should have used:

_IENavigate ($oIE, "http://127.0.0.1/my_site/download.asp?date=11_2010", 0)

Now everything works...

Alma

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...