Sign in to follow this  
Followers 0
st4vr0s

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

4 posts in this topic

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

Share this post


Link to post
Share on other sites



If you know the position of the item you could use PixelGetColor() to see whether it's checked or not.


Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

 

Share this post


Link to post
Share on other sites

Cheers guys,

Thanks for the help

If PixelGetColor(35, 333) = 0xFFFFFF Then
ControlClick ("general","3.4.7","[ID:1115]")
Else
EndIf

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  
Followers 0