4Bravo Posted November 4, 2012 Posted November 4, 2012 I'm running a batch process in Adobe Flash on a few hundred files in an array. Everything runs fine for about an hour or so, but then it says one of the files that it's opened successfully on every loop before won't open, throws up an error. I stop the script, try to open it manually and it won't open. I log off, log back in and everything goes back to normal. Is this a memory problem? Any suggestions on how to keep Windows from developing errors in the long run? Here's the code I'm using: #include <Array.au3> #include <FileOperations.au3> #include <RecFileListToArray.au3> Opt("WinWaitDelay", 200) $sPath = "D:\Animations\CYOA\Animation\Stock_Animations\Boy\Talking" $justFILE = _RecFileListToArray($sPath, "*.fla", 1, 1, 0, 0) $flaDIR = _RecFileListToArray($sPath, "*.fla", 1, 1, 0, 2) For $i = 1 To $justFILE[0] $justFILE[$i] = StringTrimRight($justFILE[$i], 4) ;MsgBox (1, '', $justFILE[$i]) next ; _ArrayDisplay($FileList) For $i = 1 To $flaDIR[0] ;MsgBox (1, '', $flaDIR[$i]) Run("C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\flash.exe " & $flaDIR[$i]) WinWaitActive($justFILE[$i]) Sleep(2000) ; send export command Send("^!C") WinWaitActive("Adobe Flash CS5.5") ; close .fla file Send("^X") Next
Moderators Melba23 Posted November 4, 2012 Moderators Posted November 4, 2012 4Bravo,Given that you say the error is caused by not being able to open a file, my immediate thought is that you are not properly closing the file on the previous pass. Perhaps you could add a check after the Send("^x") line to confirm that it has indeed closed (a loop with ProcessExists should do the trick - Run returns the process ID) and force it if required with ProcessClose. 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
water Posted November 4, 2012 Posted November 4, 2012 (edited) Which Windows version do you run? Is it always the same file? Edited November 4, 2012 by water My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
4Bravo Posted November 4, 2012 Author Posted November 4, 2012 I'm running windows 7, and the file changes. M23, flash doesn't close after the loop, it stays open for the next file. Closing it and restarting it would add 10+ seconds to a batch running 200+ files in the array.
Moderators Melba23 Posted November 4, 2012 Moderators Posted November 4, 2012 4Bravo,Then is there something you can check after the Send("^x") to confirm that particular file has closed? 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
4Bravo Posted November 5, 2012 Author Posted November 5, 2012 (edited) The only way I can confirm is by looking at the application and seeing if the window is closed. After running 5+ scripts since this post I am convinced that Flash is garbage after running a batch process for more than an hour. Is there a Autoit function to call a command like send ("^!X") to close the application after an 1 hour?? and then continue the script and call that send command every hour? Even every 30 mins would be a lot easier than shutting down the application on every loop, or trying to pick up the pieces after it crashes Edited November 5, 2012 by 4Bravo
water Posted November 5, 2012 Posted November 5, 2012 I would simply add a counter to your script. After n loops restart Flash and reset the counter. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
4Bravo Posted November 5, 2012 Author Posted November 5, 2012 Thanks for replying Water, can you show me an example of this? I don't think I know how to continue the array without starting from the beginning
water Posted November 5, 2012 Posted November 5, 2012 Is the code you showed in post #1 the latest code? Does 'Send("^X")' only close the opened .fla file but not the application? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
water Posted November 5, 2012 Posted November 5, 2012 But now you seem to send "^X" only, which - according to the comment - only closes the .fla file. If you then run flash again in the next loop don't you get hundreds of flash processes? Could you run this modified version of the script? #include <Array.au3> #include <FileOperations.au3> #include <RecFileListToArray.au3> Opt("WinWaitDelay", 200) $sPath = "D:AnimationsCYOAAnimationStock_AnimationsBoyTalking" $justFILE = _RecFileListToArray($sPath, "*.fla", 1, 1, 0, 0) $flaDIR = _RecFileListToArray($sPath, "*.fla", 1, 1, 0, 2) For $i = 1 To $justFILE[0] $justFILE[$i] = StringTrimRight($justFILE[$i], 4) ;MsgBox (1, '', $justFILE[$i]) next ; _ArrayDisplay($FileList) For $i = 1 To $flaDIR[0] ;MsgBox (1, '', $flaDIR[$i]) Run("C:Program Files (x86)AdobeAdobe Flash CS5.5flash.exe " & $flaDIR[$i]) WinWaitActive($justFILE[$i]) Sleep(2000) ; send export command Send("^!C") WinWaitActive("Adobe Flash CS5.5") ; close .fla file Send("^X") If $i = 5 then $a = ProcessList() _ArrayDisplay($a) EndIf NextHow many Flash processes do you see? My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
4Bravo Posted November 5, 2012 Author Posted November 5, 2012 After 5 files were processed I get the array and see 1 Flash.exe
water Posted November 5, 2012 Posted November 5, 2012 Then replace If $i = 5 then $a = ProcessList() _ArrayDisplay($a) EndIfwithIf Mod($i, 50) = 0 then Send("^!X") ; End Flash ProcessWaitClose("flash.exe") ; wait until the process has finished EndIfCloses flash after processing 50 files. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
4Bravo Posted November 5, 2012 Author Posted November 5, 2012 Thanks!! It ran all night and didn't crash once
water Posted November 5, 2012 Posted November 5, 2012 Glad your problem could be solved My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
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