Teldin Posted March 28, 2007 Posted March 28, 2007 (edited) HotKeySet('{F8}', '_ClickButton') Func _ClickButton() GUICtrlSetData($status, "Hotkey pressed!") ControlClick(HWnd($pWin), '', $checkerror) If GUICtrlRead ($status) <> "ERROR!" then ControlClick(HWnd($pWin), '', $nextaction) EndIf EndFunc I cannot get that function to wait for $checkerror before it runs $nextaction Sleep does not work and I've tried to put them in seperate functions but it always runs to the end before looking at $checkerror. I assume this is by design but how can I wait for $checkerror so $nextaction knows weather to run or not? Edited March 28, 2007 by Teldin
Developers Jos Posted March 28, 2007 Developers Posted March 28, 2007 (edited) HotKeySet('{F8}', '_ClickButton') Func _ClickButton() GUICtrlSetData($status, "Hotkey pressed!") ControlClick(HWnd($pWin), '', $checkerror) If GUICtrlRead ($status) <> "ERROR!" then ControlClick(HWnd($pWin), '', $nextaction) EndIf EndFunc I cannot get that function to wait for $checkerror before it runs $nextaction Sleep does not work and I've tried to put them in seperate functions but it always runs to the end before looking at $checkerror. I assume this is by design but how can I wait for $checkerror so $nextaction knows weather to run or not? You are not clear on what you need to wait for... Assume you click some button and then what happens ? Edited March 28, 2007 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Teldin Posted March 28, 2007 Author Posted March 28, 2007 My hotkey copies highlighted text, clicks an GUI button to check for a specific format. If it matches a format ($checkerror), another button is pressed ($nextaction). If not, nothing should happen. Unfortunately, the second button is always clicked because it only check for errors after the function has finished.
Developers Jos Posted March 28, 2007 Developers Posted March 28, 2007 My hotkey copies highlighted text, clicks an GUI button to check for a specific format. If it matches a format ($checkerror), another button is pressed ($nextaction). If not, nothing should happen. Unfortunately, the second button is always clicked because it only check for errors after the function has finished.Understood this part ... but how can you test for the first button press to be finished ?Any unique text in the GUI or something that tells you the first button function ended? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Teldin Posted March 29, 2007 Author Posted March 29, 2007 (edited) >Any unique text in the GUI or something that tells you the first button function ended? That's exactly what $status does. Shows ERROR if the $checkerror finds an error. The problem is the first button does not execute until the end of the my function (_ClickButton) It seems as if all the commands are queued until the function completes successfully, in which case all queued commands are executed in rapid sucession. Edited March 29, 2007 by Teldin
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