Moderators Melba23 Posted November 10, 2011 Moderators Share Posted November 10, 2011 rds_correia, Are you at least seing a list of "File: File_name" lines? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rds_correia Posted November 10, 2011 Author Share Posted November 10, 2011 Nope. The only box that opens is the one that says "all files dealt with". Weird. Link to comment Share on other sites More sharing options...
rds_correia Posted November 10, 2011 Author Share Posted November 10, 2011 Ok. Maybe I'm a bit tired, and because of that, doing something wrong. Will go home, have some sleep and try it again tomorrow. Thanks a bunch for your help Melba23 . Cheers Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 10, 2011 Moderators Share Posted November 10, 2011 rds_correia,The only box that opens is the one that says "all files dealt with".There are no other dialogs - the data appears in the lower pane of SciTE. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rds_correia Posted November 10, 2011 Author Share Posted November 10, 2011 I'm running the portable version of AutoIt (the self extractable zip). Therefore, I run a script by running AutoIt3.exe and then I open the desired script. Does SciTE run, when I execute a script via AutoIt3.exe? Or do I need to open SciTE manually? SciTE is a text editor/IDE, right? Cheers Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 10, 2011 Moderators Share Posted November 10, 2011 rds_correia,SciTE is the editor which is installed with Autoit - but as you have not installed it...... You are missing a lot - the full version od SciTE4AutoIt3 which you can download here offers lots of extra goodies to help you code in AutoIt. But I believe you need to have both SciTE and AutoIt installed for it to give you full functionality. Try this version which only uses MsgBox dialogs: expandcollapse popup#include <Array.au3> #include <File.au3> #include <Date.au3> Global $sRoot = "C:surveillance" Global $aPath[5] = [4, "580001", "000", "00", "00"] Global $sCamera_ID = "323" Global $sYesterday = StringReplace(_DateAdd("D", -1, @YEAR & "/" & @MON & "/" & @MDAY), "/", "-") Global $sBefore_Yesterday = StringReplace(_DateAdd("D", -2, @YEAR & "/" & @MON & "/" & @MDAY), "/", "-") ; Find last folder $aFolder_List = _Last_Folder($aPath) ; Work backwards through the folder list For $i = $aFolder_List[0] To 1 Step -1 ; Read the list of files in this folder $aFile_List = _FileListToArray($aFolder_List[$i] & "", "*.xml", 1) ;_ArrayDisplay($aFile_List, $aFolder_List[$i]) If IsArray($aFile_List) Then If _Check_Files($aFile_List, $aFolder_List[$i]) Then ; We have reached the files from 2 days ago ExitLoop EndIf Else ; There are no files to check - this should never happen ExitLoop EndIf Next MsgBox(0, "Done", "All files from " & $sYesterday & @CRLF & "taken by camera " & $sCamera_ID & @CRLF & "have been dealt with") Func _Check_Files($aArray, $sPath) ; Clear the "day before yesterday" flag $fEnded = False For $i = $aArray[0] To 1 Step -1 ; Read the content of the file $sFile_Content = FileRead($sPath & $aArray[$i]) ; Is it the correct date $aDate = StringRegExp($sFile_Content, "(?i)(?U)starttime>(.*)x20", 3) Switch $aDate[0] Case $sYesterday ; Is it the correct camera $aCamera = StringRegExp($sFile_Content, "(?i)(?U)servicename>(.*)<", 3) If $aCamera[0] = $sCamera_ID Then ; Extract the .avi name $aAVI = StringRegExp($sFile_Content, "(?i)(?U)filename>(.*)<", 3) ; And display the data MsgBox(0, "Action needed", _ "File: " & $sPath & $aArray[$i] & @CRLF & @CRLF & _ "Avi: " & $sPath & $aAVI[0] & @CRLF & " could now be copied") EndIf Case $sBefore_Yesterday ; Set the flag $fEnded = True ; No point in going back further ExitLoop EndSwitch Next Return $fEnded EndFunc Func _Last_Folder($aPath) ; Create an array to hold the list of folders found Local $aFolders[100] = [1, $sRoot & _ArrayToString($aPath, "", 1, 4) & ""] While 1 ; Add 1 to the folder and reset to 00 if needed $aPath[4] = StringFormat("%02i", Mod($aPath[4] + 1, 100)) ; If we did reset to 00 then we need to check the level above If $aPath[4] = "00" Then ; Again we add 1 and reset to 00 if required $aPath[3] = StringFormat("%02i", Mod($aPath[3] + 1, 100)) ; And if we reset to 00 we need to check the level above If $aPath[3] = "00" Then ; Add 1 but this time we reset to 000 if required $aPath[2] = StringFormat("%03i", Mod($aPath[2] + 1, 1000)) ; And again we move up a level if the lower folder was reset If $aPath[2] = "000" Then ; If this one gets to 589999 then you need to restart - or add another level to this tree! $aPath[1] = $aPath[1] + 1 EndIf EndIf EndIf ; Now see if this path exists $sNext_Path = $sRoot & _ArrayToString($aPath, "", 1, 4) & "" If Not FileExists($sNext_Path) Then ; If the path does not exist then we return the list of folders found ReDim $aFolders[$aFolders[0] + 1] Return $aFolders Else ; The folder exists so add it to the array - resizing if necessary $aFolders[0] += 1 If UBound($aFolders) <= $aFolders[0] Then ReDim $aFolders[$aFolders[0] * 2] EndIf $aFolders[$aFolders[0]] = $sNext_Path EndIf WEnd EndFuncDo you get the results now? M23 rds_correia 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rds_correia Posted November 11, 2011 Author Share Posted November 11, 2011 Do you get the results now? Yeah!! It works So instead of showing the filename in the MsgBox, I should use FileMove to move the files to another directory, right?Cheers Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 11, 2011 Moderators Share Posted November 11, 2011 rds_correia, Yeah!! It worksGood - I was getting a bit worried there for a minute! Yes, you have the full file path and name with $sPath & $aAVI[0] and you can use FileMove to get it where you wish. Good luck with the GUI wrapper - as I said before, you know where we are if you run into difficulties. M23 rds_correia 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rds_correia Posted November 11, 2011 Author Share Posted November 11, 2011 This is gonna be a real life-saver. Thanks a bunch mate. Cheers Link to comment Share on other sites More sharing options...
rds_correia Posted November 17, 2011 Author Share Posted November 17, 2011 Hi Melba23, I've been out for a couple of days and now I'm going to work on the GUI. I was wondering: why do you add a letter to each variable name? Like the 'a' in '$aPath', the 's' in '$sRoot', etc. Just wondering, you know? Cheers Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 17, 2011 Moderators Share Posted November 17, 2011 rds_correia,Because I try to follow these coding guidelines in all my AutoIt code. But be aware there is a new version coming out soon which will offer more comprehensive advice. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
rds_correia Posted February 20, 2012 Author Share Posted February 20, 2012 Hi Melba23, I have been using your script above with a lot of success. But now the cameras will start recording to a local PC instead of recording to a centralized PC server. We've been having some issues with some cameras and tech support says that way the cameras will work better. Only issue is I have tried your script using: Global $sRoot = "\\ip_of_the_local_pc\surveillance\" But now it doesn't work. Not even if I map that network path. Can you give me a hand with this? Thanks in advance. Cheers Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 20, 2012 Moderators Share Posted February 20, 2012 rds_correia, I am afraid I know next to nothing about networks. I suggest you start a new thread and seek the help of someone who does. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
saywell Posted February 20, 2012 Share Posted February 20, 2012 Why not run a script on each local PC that copies all the files to your central computer? If you use the original script you could modify it to sort the files by camera before sending them. Or it could just send them all as they come, and work as previously with your script separating them out by camera and date on the central computer. William rds_correia 1 Link to comment Share on other sites More sharing options...
rds_correia Posted February 23, 2012 Author Share Posted February 23, 2012 rds_correia,I am afraid I know next to nothing about networks. I suggest you start a new thread and seek the help of someone who does. M23No problem.I'll try to work around this using saywell's idea.Regards Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now