I have come across a problem where I have set up multiple event triggers using the OnEvent command.
When 1 event triggers, the expected routine is called.
If a 2nd (different) event occurs whilst the first event is still being processed, then the 2nd event is not being triggered until the original handler routine has completed.
Example code below is used to trigger HandleNotePad when Notepad is opened, which then starts Windows Explorer. A 2nd Event handler is set up to display a Message if Explorer opens.
Code: Select all
OnEvent>WINDOW_OPEN,Untitled - Notepad,1,HandleNotePad
OnEvent>WINDOW_OPEN,Computer,1,HandleExplorer
Repeat>True
Wait>1
Until>True
SRT>HandleNotePad
IF>_HandleNotePad=1,ExitHandleNotePad
Let>_HandleNotePad=1
' Open Explorer
PRess LWinKey
Send>e
Release LWinKey
'Repeat>True
' Wait>1
'Until>True
Label>ExitHandleNotePad
END>HandleNotePad
SRT>HandleExplorer
IF>_HandleExplorer=1,ExitHandleExplorer
Let>_HandleExplorer=1
MDL>Here!
Label>ExitHandleExplorer
END>HandleExplorer
With the Repeat...Until code commented out in the HandleNotePad routine, both events are able to trigger and the Here! message appears.
With the Repeat...Until code not commented out, Explorer is opened, but no Here! message appears.
Can you advise how to get around this problem as we have some scripts that are causing problems when multiple events happen almost simultaneously.