Jump to content
Sign in to follow this  
victorhooi

ControlClick() - Proceed after a delay? ; Selecting Controls

Recommended Posts

victorhooi

I have two small questions about using ControlClick, and selecting controls using it.

Firstly, is there a way to make ControlClick statements optional, or somehow have AutoIt run through them, and after a certain delay, proceed? Basically, the script I'm writing has to click through a dialog box that only appears for certain items - I'd like to click the appropriate button (in this case, Open as Read Only) on the items that the dialog does appear for, and just proceed to the next step for items that don't.

The second question is involving using CLASS to select controls for ControlClick().

ControlClick("Clients and their Tax Forms", "", "[CLASS:THsControlButton; TEXT:Se&lect; INSTANCE:2]")

I have a few lines like the above, and they don't seem very reliable, in particular regarding the TEXT part. It just seems that when selecting certain items, it doesn't seem to work all that line, even though the TEXT on the button is the same. Also, how would you put in text with spaces (nested quotation marks don't seem to work).

I suppose it's just as reliable to just use CLASS and INSTANCE? These aren't likely to change on each run?

Cheers,

Victor

Share this post


Link to post
Share on other sites
herewasplato

Welcome to the forum.

> ... I'd like to click the appropriate button (in this case, Open as Read Only) on the items that the dialog does appear for, and just proceed to the next step for items that don't.

"the next step" should have a WinWait line to "halt" the script until the window of interest appears. Then look at AdlibEnable... that lets you run code while the main part of the script is "halted" - code like:

If WinExists... Then

Do

Sleep

Until ControlCommand ..... "IsEnabled", ""

ControlClick

EndIf

As for the second question - that code should be okay. I would need to see the code just prior to that ControlClick to ensure that you are waiting for the control to be enabled before you have the script click on it.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.