Sign in to follow this  
Followers 0
jbzy324

Wait for control to be clicked in program

2 posts in this topic

Hey all; I was wondering if anybody has had success pausing/stalling a script until a certain control is clicked.  I'm writing a hotkey script for a program, but I only want the hotkeys active when you get to a certain editing mode in the program.  You activate and deactivate this mode by clicking two different controls, so I'd like to write into the script a loop that waits until that control is clicked, activates the hotkey script, then deactivates when the second control to exit the edit mode is clicked.  Anybody have any ideas how this might be done?

Thanks in advance.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I use code like this to click on a particular button (which becomes 'grayed out' while that process is executing), then wait until that button is enabled again (which indicates that process is done)

ControlCommand("Forum Spam List Checker", "", "Button1", "Check") ; Query/Search button
Sleep(100)
Do
  Sleep(100)
Until ControlCommand("Forum Spam List Checker", "", "Button1", "IsEnabled") ; Wait until Search/Query is done
I realize this is not exactly what you want, hopefully you'll see how the ControlCommand function can be used to reach your goal. Good luck with your project. Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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