Jump to content
Sandhya

To check required checkbox

Recommended Posts

Sandhya

To activate the window and select the required checkbox (Ethernet), I used the below lines of code.

Is this correct? It is not working fine.

WinWaitActive ("Select the host interfaces you want to search ...", "[CLASS: Button]")

ControlCommand ("Select the host interfaces you want to search ...", "", "[TEXT: Ethernet]", "Check", "")

Share this post


Link to post
Share on other sites
Danyfirex

winwaitactive Pauses execution of the script until the requested window is active. (it does not activate the window). to activate the window (focus) use WinActivate.

in controlcommand use CLASS instead TEXT

Saludos

Share this post


Link to post
Share on other sites
Sandhya

when I am opening that window, the button id is changing each time. So I need to search for text and enable it.

 

Share this post


Link to post
Share on other sites
noobieautolearn

You could use Opt("WinTitleMatchMode", 2) before the command and then use WinWaitActive ("Select the host interfaces you want to search") if "Select the host interfaces you want to search" stays the same all the time it will recognize the window and then use controlclick with the x/y coordinates for that specific window where you want it to fill in the checkbox or then use your second command and see if it works now that autoit sees the window.

Edited by noobieautolearn

Share this post


Link to post
Share on other sites
Sandhya

It is not working.

the window title and buttons present inside the window are same. Only the button number for each checkbox are varying each time.

 

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

×

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.