I see you are sending ALT-acn. On my PC ALT-A opens the Action menu. Alt-C performs "Clear all events.." which causes a new dialog to open. Alt-N then selects the "No" button.
Your script is trying to send ALT-acn all in one go - the script is sending this within milliseconds of each other. But that new dialog is going to take longer than that. Basically you're not making the script wait for that dialog to appear and those keystrokes are just going nowhere too fast. You want to do:
//Do Action/Clear...
Press ALT
Send>ac
Release ALT
//Wait for the new dialog
WaitWindowChanged>0
//Now I can send ALT-N
Wait>0.2
Press ALT
Send>n
Release ALT
//Now I should wait until I know that dialog has gone again
WaitWindowChanged>0
Basically you need to allow time for the keystrokes to have an affect before you continue to send more keystrokes. If you send keystrokes before the target window has appeared to accept them nothing is going to happen. If you send a bunch of keystrokes without any breathing space between them the target window may not get a chance to process them.
So, I would do:
Code: Select all
Run>eventvwr.exe
WaitWindowOpen>Event Viewer
Let>x=0
Repeat>x
SetFocus>Event Viewer
Let>x=x+1
Press Down
//There's probably a better way to do this but you need a decent
// delay here because it can take a while for the event list to populate
// when you go down to the next event log
Wait>2
//Do Action/Clear...
Press ALT
Send>ac
Release ALT
//Wait for the new dialog
WaitWindowChanged>0
//Now I can send ALT-N
Wait>0.2
Press ALT
Send>n
Release ALT
//Now I should wait until I know that dialog has gone again
WaitWindowChanged>0
Until>x=8
Note I've added a delay after the Press Down. It can take a while for the event list to populate. A fixed delay is not the most reliable method as we cannot guarantee that this is ever enough. Though for unattended automation we usually wouldn't care if we made it wait 10 seconds longer than necessary as we won't be watching it anyway. There will be other ways to wait exactly the precise amount of time - probably by capturing text from the status bar/columns or using image recognition. But keep it simple to begin with by using a fixed delay.
I've also put the SetFocus inside the loop to avoid any situation where something else might steal the focus while the macro is running.
Please read Scripting Windows for Beginners in the help file which explains all the concepts I've used above which you will need for automating most tasks. Also read this:
http://www.mjtnet.com/blog/2006/01/17/h ... on-script/