Jump to content

Wait until button is not grey anymore


Ysengrim
 Share

Recommended Posts

Hello,

I'm writing a macro for a program I use every day

I found all the stuff to start the program, wait for a window and push a button ...

But after pushing the button the button goes "grey" (unactive) because the program does an action in the background (never the same in time)

When the program ended its action the button goes normal again (black)

So I have to pause the script until that button is activate again - thats the only thing I'm sure of to continu the macro

What do I have to use for that ?

i read all the Control commands and tried a few but I didn't get the thing to check if the button is active

my last command is for pressing the go button in the program is : ControlClick("Title","",24)

thanks

ysengrim

Link to comment
Share on other sites

Maybe use ControlCommand()

"IsEnabled", "" Returns 1 if Control is enabled, 0 otherwise

8)

Valuater, you were very helpfull thanks

I already tried that command but I must have done something wrong because it didn't worked so I wend searching for other commands

Now that you did tell me that that command was the right one I tried again and again till I found what I did wrong before

I thank you very much !!!

Link to comment
Share on other sites

Valuater, you were very helpfull thanks

I already tried that command but I must have done something wrong because it didn't worked so I wend searching for other commands

Now that you did tell me that that command was the right one I tried again and again till I found what I did wrong before

I thank you very much !!!

If you can't get the state directly from the control you can always use PixelGetColor() or PixelCheckSum() to test if the coulour is greyed or normal.

I frequently use these methods to check the state of buttons on toolbars.

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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