Noob Posted August 9, 2006 Share Posted August 9, 2006 If WinActive("Notepad") Then HotKeySet("a", "myfunction") Else HotKeySet("a") EndIf Func myfunction() ; my function includes several ControlClicks etc EndFunc Another question by Noob. I just don't know how to do this even after trying a variety of things since the weekend. Any help would be greatly appreciated. * I only want the function to run once, even when the hotkey is pressed more then once while the function is running. * When the function ends, then I want the function to be ready again to start when the hotkey is pressed. * I don't want the function to be interrupted by multiple presses of the hotkey (or other hotkeys) * I don't want the function to run multiple times when user mistakenly presses the hotkey multiple times Link to comment Share on other sites More sharing options...
BigDod Posted August 9, 2006 Share Posted August 9, 2006 Change function to Func myfunction() HotKeySet("a") ; my function includes several ControlClicks etc HotKeySet("a", "myfunction") EndFunc Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Noob Posted August 9, 2006 Author Share Posted August 9, 2006 Wow, that did it for me! (I was agonizing a few days over this!) Thanks VERY much! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now