Jump to content

ControlClick() fails on Open and Save but not Cancel in IE dialog


fgx00171
 Share

Recommended Posts

My script is meant to drive the 'File Download' dialog of an Internet Explorer window, and assumes the dialog is visible when the script starts. Here's what I have so far:

WinWait("File Download");

WinActivate("File Download");

ControlClick("File Download", "","[CLASS:Button; INSTANCE:2]");

I have a problem here in that the last command (ControlClick) doesn't click the 'Save' button. It DOES make the 'Save' button on the dialog get focus (it's border gets highlighted).

If I change the last command to:

ControlClick("File Download", "","[CLASS:Button; INSTANCE:1]");

then the 'Open' button gets highlighted (but not pressed). If I change it to:

ControlClick("File Download", "","[CLASS:Button; INSTANCE:3]");

Then the 3rd ('Cancel') button does get pressed, and the dialog disappears.

It seems as though something is different about the way the script is treating the Open and Save buttons vs. the Cancel button?

Any info appreciated.

Link to comment
Share on other sites

The file open and save dialogs get special protection from automated inputs for security reasons. Cancel doesn't have the same risks as open or save, so it doesn't get the same protection. There are work-arounds posted. Search the forum.

:)

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
Link to comment
Share on other sites

My script is meant to drive the 'File Download' dialog of an Internet Explorer window, and assumes the dialog is visible when the script starts. Here's what I have so far:

WinWait("File Download");

WinActivate("File Download");

ControlClick("File Download", "","[CLASS:Button; INSTANCE:2]");

I have a problem here in that the last command (ControlClick) doesn't click the 'Save' button. It DOES make the 'Save' button on the dialog get focus (it's border gets highlighted).

If I change the last command to:

ControlClick("File Download", "","[CLASS:Button; INSTANCE:1]");

then the 'Open' button gets highlighted (but not pressed). If I change it to:

ControlClick("File Download", "","[CLASS:Button; INSTANCE:3]");

Then the 3rd ('Cancel') button does get pressed, and the dialog disappears.

It seems as though something is different about the way the script is treating the Open and Save buttons vs. the Cancel button?

Any info appreciated.

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...