Jump to content

Application, or possible windows developing errors after a while on batch


4Bravo
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Which Windows version do you run?

Is it always the same file?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

  • Moderators

4Bravo,

Then is there something you can check after the Send("^x") to confirm that particular file has closed? :huh:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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 by 4Bravo
Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

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 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

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
Next
How many Flash processes do you see?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

Then replace

If $i = 5 then
$a = ProcessList()
_ArrayDisplay($a)
EndIf
with
If Mod($i, 50) = 0 then
  Send("^!X") ; End Flash
  ProcessWaitClose("flash.exe") ; wait until the process has finished
EndIf
Closes flash after processing 50 files.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

Glad your problem could be solved :D

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.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 (NEW 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

 

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...