Jump to content
Sign in to follow this  
fgx00171

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

Recommended Posts

fgx00171

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.

Share this post


Link to post
Share on other sites
PsaltyDS

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

Share this post


Link to post
Share on other sites
AnselRoe

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.

Share this post


Link to post
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
Sign in to follow this  

×