OnEvent>FILE_EXISTS,%temp_Dir%FolderForDetectingFiles\*.*,0,srtAutoDetect
Will never stop firing even though there are no files in the specified folder. If I change the file specification to *.TXT for example, the OnEvent> correctly triggers only when it contains a file with the .txt extension. I have used this before using a more specific file type but this is the first time I've tried finding all files. I can get around this by writing a custom OnEvent but why does this script not work as I expect it to work?
Code: Select all
CreateDir>%temp_dir%FolderForDetectingFiles
Let>AA=0
Let>BB=0
message>
OnEvent>FILE_EXISTS,%temp_Dir%FolderForDetectingFiles\*.*,0,srtAutoDetect
SRT>srtAutoDetect
Add>BB,1
SetControlText>Macro Scheduler Message,TMemo,1,AA=%AA% BB=%BB%
END>srtAutoDetect
Label>Loop
Wait>1
Add>AA,1
If>AA=5
Goto>End
EndIf
Goto>Loop
Label>End
//If you don't turn off the File_Exist OnEvent, the folder can't be deleted.
OnEvent>FILE_EXISTS,%temp_Dir%FolderForDetectingFiles\*.*,0,
Wait>1
DeleteFolder>%temp_Dir%FolderForDetectingFiles