Jump to content

Possible to check if "check/selection" boxes are ticked or not?


st4vr0s
 Share

Recommended Posts

Hi,

I'm writing a test scrip that opens an application, sets my variables by selecting certain options within preferences and then runs the program.

These options are selected by ticks in boxes.

As I will be running the program a number of times I do not want it to tick or untick my chosen preferences each time I run it.

Is it possible for the script to check if the tick is already present and not to select if it is?

Thanks

Link to comment
Share on other sites

  • On some lvl it is if we are talking about normal check box
Here is example bassed on XP volume controll

If WinExists('Volume Control') Then
    WinActivate('Volume Control')
    WinWaitActive('Volume Control')
Else
    MsgBox(16,'No win to play with','Pls start volume control from notification area before you run the script next time' & @CRLF & 'Script will now exit')
    Exit
EndIf
$check = ControlCommand ( "Volume Control", "", '[CLASS:Button; INSTANCE:2]', "IsChecked", "" )
If $check Then
    MsgBox(32,'Status of box is '&$check&' Checked','we will attempt to change it')
    ControlCommand ( "Volume Control", "", '[CLASS:Button; INSTANCE:2]', "UnCheck", "" )
  
    $check = ControlCommand ( "Volume Control", "", '[CLASS:Button; INSTANCE:2]', "IsChecked", "" )
    If Not $check Then
        MsgBox(64,'Status of box is '&$check&' Unchecked','Script will now exit')
    Else
        MsgBox(16,'Status of box is '&$check&' Checked','Nothing happens, reason unknown, script will now exit')
    EndIf
Else
    MsgBox(32,'Status of box is '&$check&' Unchecked','we will attempt to change it')
    ControlCommand ( "Volume Control", "", '[CLASS:Button; INSTANCE:2]', "Check", "" )
    $check = ControlCommand ( "Volume Control", "", '[CLASS:Button; INSTANCE:2]', "IsChecked", "" )
  
    If $check Then
        MsgBox(64,'Status of box is '&$check&' Checked','Script will now exit')
    Else
        MsgBox(16,'Status of box is '&$check&' Unchecked','Nothing happens, reason unknown, script will now exit')
    EndIf
EndIf
Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
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...