z3r0c00l12 wrote:I'd say there might be a problem saving the pictures which would explain why you would only get one every 6 seconds, or maybe the filenames turn out to be the same so the file is just overwritten?
#Include <File.au3>
Global $Yesterday = ""
Global $CurrentDay = @YEAR & "-" & @MON & "-" & @MDAY
Global $Folder = "E:\Video\"
;{date}_{tstamp}_{tstampMS}.jpg = 2011-03-16_19.31.50_796.jpg
While 1 ;Always Loop
_Sort()
Sleep(60 * 1000) ;Wait 60 seconds before looping
Wend
Func _Sort()
Local $FileArray = "", $Move = 0 ;Declaring variables
If $CurrentDay <> @YEAR & "-" & @MON & "-" & @MDAY Then ;If It's a new day
$Yesterday = $CurrentDay ;Yesterday's date
$CurrentDay = @YEAR & "-" & @MON & "-" & @MDAY ;Today's date
DirCreate($Folder & $Yesterday) ;Create folder for Yesterday
$FileArray = _FileListToArray($Folder, $Yesterday & "*.jpg", 1) ;Find all files in E:\Video that are Yesterday and .jpg
If IsArray($FileArray) AND $FileArray[0] > 0 Then ;Checking if there was an error producing the Array
For $x = 1 To $FileArray[0] ;Loop through the list of files for Yesterday
$Move = FileMove($Folder & $FileArray[$x], $Folder & $Yesterday & "\", 9) ;Move the file to Yesterday's folder
If $Move = 0 Then MsgBox(0x10,"Yawcam File Move","Unable to move file " & $FileArray[$x])
;If there's an error, it will popup a Msgbox and wait until someone closes it
Next
EndIf
EndIf
EndFunc


Users browsing this forum: No registered users and 0 guests