if i use the code below,
when the new file did downloaded (which is not tmp or crdownload),
it will show the msgbox, and the watch action will stop automatically, right?
and my question is, how to set a timeout, when the watch action got no result (no new file added) after a period
redo some action and watch again, and again, until redo times reach to a seted limit
thanks sir
Code: Select all
WatchFolder(download_folder, "ReportFunction")
ReportFunction(Directory, Changes) {
Static MyExtensions := "tmp,crdownload"
For Each, Change In Changes {
Action := Change.Action
Name := Change.Name
SplitPath, Name, , , Extension
If Extension In MyExtensions ; skip files depending on the extension
Continue
; -------------------------------------------------------------------------------------------------------------------------
; Action 1 (added) = File gets added in the watched folder
If (Action = 1)
MsgBox, %Name%
}
}