
4Bravo
Active Members-
Posts
20 -
Joined
-
Last visited
Everything posted by 4Bravo
-
Thanks! Works great
-
I think the function I need to use is StringSplit, but not 100% sure How to I get the file name and extension from a full path being sent though the command line argument as $CmdLine[1] ? I would normally use LastIndexOf ("\")
-
Thanks
-
I'm trying to write a script that processes different folders, if new files have been moved into them $newFILE = _RecFileListToArray($sPath, "*.txt", 1, 1, 0, 0) If $newFILE[0] > 0 Then this works fine if there are new files in the folder, but it returns an error on [0] if there isn't. How can I skip this section of code if array doesn't exist?
-
This seemed like a no-brainier, I want to merge a folder on the desktop with a folder in Desktop\Temp with the same names but when I run DirMove ("C:\Users\Me\Desktop\temp\Older_Stuff", "C:\Users\Me\Desktop") it places 'older_stuff' from temp, into the directory on the desktop.. Any Suggestions?
-
I've double checked the arrays, and used the function manually, with out the array. But I don't know where to plug this FileCopy in a For and Next. Every time I execute it I get an oddly named file in the directory the script was launched from. Blah... I realised I forgot [$i] after the array #include <Array.au3> #include <RecFileListToArray.au3> AutoItSetOption("TrayIconDebug",True) $sPath = "D:Temp" $movFILE = "D:mov.veg" $flaDIR = _RecFileListToArray($sPath, "*.fla", 1, 1, 0, 2) $justFILE = _RecFileListToArray($sPath, "*.fla", 1, 1, 0, 0) For $i = 1 To $justFILE[0] $justFILE[$i] = StringTrimRight($justFILE[$i], 4) next For $i = 1 To $flaDIR[0] $flaDIR[$i] = StringReplace($flaDIR[$i], $justFILE[$i] & ".fla", "") FileCopy($movFILE, $flaDIR[$i]) next
-
Script acting up on second time around a loop
4Bravo replied to 4Bravo's topic in AutoIt General Help and Support
Thanks! The problem was the sorted parameter in the _RecFileListToArray was actually sorting the files differently -
I'm continuing to have problems with Flash and Autoit. This time I am able to execute everything I want on the first item in an array, but as soon as the second item in the array loads the script stops. I used to be able to try to jump start the script by getting it to the next WinWaitActive window, but that does not seem to work anymore I changed my hotkeys to use plain menu keys to navigate around as I thought that might have been the problem, but it does not help nor hinder the problem #include <Array.au3> #include <RecFileListToArray.au3> $sPath = "D:AnimationsCYOAApplicationApplication_AssetsCharacter_RendersHero_Anim" $FileList = _RecFileListToArray($sPath, "*.fla", 1, 1, 1, 2) $justFILE = _RecFileListToArray($sPath, "*.fla", 1, 1, 1, 0) $flaDIR = _RecFileListToArray($sPath, "*.fla", 1, 1, 1, 2) For $i = 1 To $justFILE[0] $justFILE[$i] = StringTrimRight($justFILE[$i], 4) next For $i = 1 To $flaDIR[0] $flaDIR[$i] = StringReplace($flaDIR[$i], $justFILE[$i] & ".fla", "") next For $i = 1 To $FileList[0] Run("C:Program Files (x86)AdobeAdobe Flash CS5.5flash.exe " & $FileList[$i]) WinWaitActive($justFILE[$i]) WinWaitNotActive("Adobe Flash CS5.5") ;export movie Send("!") Send("f") Send("e") Send("m") WinWaitActive("Export Movie") ; set new filepath and name ;Use this line if you want the render to have the same name as the movie ;Send($flaDIR[$i] & $justFILE[$i] & ".Mov") Send($flaDIR[$i] & "Render.Mov") Send("{ENTER}") ;overwrite if file exists WinWaitActive("Confirm Save As", "", 1) Send("{y}") WinWaitActive("QuickTime Export Settings") ; dismiss export settings dialg Send("{ENTER}") WinWaitActive("Adobe Flash CS5.5") ; dismiss export settings dialg Send("{ENTER}") ; wait for export to finish WinWaitActive($justFILE[$i]) ; close .fla file Sleep(1000) Send("!") Send("f") Send("c") WinWaitActive("Adobe Flash CS5.5") Next I added the WinWaitNotActive("Adobe Flash CS5.5") after the file loads just to double check that the file was open, it hasn't changed the problem. Any thoughts?
-
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
-
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
-
_FileListToArray And FileFindNextFile
4Bravo replied to 4Bravo's topic in AutoIt General Help and Support
got this to work #include <Array.au3> #include <FileOperations.au3> #include <RecFileListToArray.au3> Opt("WinWaitDelay", 200) $sPath = "D:AnimationsCYOAAnimationStock_AnimationsBoyTalking" $FileList = _FO_FileSearch($sPath, '*fla', True, 125, 1 ) $justFILE = _RecFileListToArray($sPath, "*.fla", 1, 1, 1, 0) $flaDIR = _RecFileListToArray($sPath, "*.fla", 1, 1, 1, 2) For $i = 1 To $justFILE[0] $justFILE[$i] = StringTrimRight($justFILE[$i], 4) next For $i = 1 To $flaDIR[0] $flaDIR[$i] = StringReplace($flaDIR[$i], $justFILE[$i] & ".fla", "") next ; _ArrayDisplay($FileList) For $i = 1 To $FileList[0] Run("C:Program Files (x86)AdobeAdobe Flash CS5.5flash.exe " & $FileList[$i]) ;MsgBox(0, "", $justFILE[$i]) WinWaitActive($justFILE[$i]) ; send export command Send("^m") WinWaitActive("Export Movie") ; set new filepath and name Send($flaDIR[$i] & $justFILE[$i] & ".Mov") Send("{ENTER}") WinWaitActive("QuickTime Export Settings") ; dismiss export settings dialg Send("{ENTER}") WinWaitActive("Adobe Flash CS5.5") ; dismiss export settings dialg Send("{ENTER}") ; if you're not using MX 2004 Pro, edit the following line to match the Window title of your version WinWaitActive($justFILE[$i]) ; close .fla file Send("^X") Next This exports an MOV file to the directory the file was opened from. I probably didn't need to use both array functions, but they work together in the end. -
_FileListToArray And FileFindNextFile
4Bravo replied to 4Bravo's topic in AutoIt General Help and Support
Thank you, both of these are on the right track. Is there a way to trim $aList[$i] OR$FileList[$i] So it just has the file name in it and not the path from my dir to where it found the file? it's needed for the first WinWaitActive function $aList[$i]is opening the file just fine, but it is then waiting for /dir/dir/file.fla whenit should be looking for file, no extention -
_FileListToArray And FileFindNextFile
4Bravo replied to 4Bravo's topic in AutoIt General Help and Support
I'm trying to perform a set of commands on every file in all subdirectories of a given path, one file a time. In the example above I'm using flash to export a quicktime, but I need it for a few other things as soon as I figure out how to attach the $file variable to any of the results I get from RecFilesListToArray or _FO_FileSearch -
_FileListToArray And FileFindNextFile
4Bravo replied to 4Bravo's topic in AutoIt General Help and Support
Thank you for replying, I have tried the with similar results. and after trying this _FO_FileSearch it seems to be the same. I get a list of files that is show in _ArrayDisplay. But where do I go from there? I've tried FileFindNextFile and the script doesn't want to do anything, it doesn't even return errors #include <Array.au3> #Include <FileOperations.au3> $sPath = "D:AnimationsCYOAAnimationStock_AnimationsBoyTalking" $FileList = _FO_FileSearch($sPath,'*fla') _ArrayDisplay($FileList) While 1 $file = FileFindNextFile($FileList) If @error Then ExitLoop ;c:tmp in the following line can be edited to your choice of file location Run("C:Program Files (x86)AdobeAdobe Flash CS5.5flash.exe $sPath" & $file) $file = StringTrimRight($file, 4) WinWaitActive($file) ; send export command Send("^m") WinWaitActive("Export Movie") ; set new filepath and name Send("C:tmp" & $file & ".Mov") Send("{ENTER}") WinWaitActive("QuickTime Export Settings") ; dismiss export settings dialg Send("{ENTER}") WinWaitActive("Adobe Flash CS5.5") ; dismiss export settings dialg Send("{ENTER}") ; if you're not using MX 2004 Pro, edit the following line to match the Window title of your version WinWaitActive($file) ; close .fla file Send("^!x") ;Send("n") WEnd ; Close the search handle FileClose($FileList) -
I apologize if this is fairly simple, I've spend more hours than I want to on it and can't seem to get Autoit to work on every file in a subdirectory. I've tried _FileListToArray and _FileListToArrayex but my complete lack of programming knowledge and copy and paste programming has only gotten me frustrated. I am able to run the following script on 1 directory and all file sin the directory: While 1 $file = FileFindNextFile($search) If @error Then ExitLoop ;c:\tmp in the following line can be edited to your choice of file location Run("C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\flash.exe $sAutoItDir\" & $file) $file = StringTrimRight($file, 4) WinWaitActive($file) ; send export command Send("^m") WinWaitActive("Export Movie") ; set new filepath and name Send("C:\tmp\" & $file & ".Mov") Send("{ENTER}") WinWaitActive("QuickTime Export Settings") ; dismiss export settings Send("{ENTER}") WinWaitActive("Adobe Flash CS5.5") ; dismiss export settings dialg Send("{ENTER}") ; if you're not using MX 2004 Pro, edit the following line to match the Window title of your version WinWaitActive($file) ; close .fla file Send("^!x") ;Send("n") WEnd ; Close the search handle FileClose($search) But when I tried to run that on subdirectories I couldn't seem to search the array: #include <File.au3> #include <Array.au3> #include "FileListTOArrayEx.au3" $sAutoItDir = "D:\Animations\CYOA\Animation\Stock_Animations\Boy\Talking" $aArray = _FileListToArrayEx($sAutoItDir, "*.fla", 0 + 8 + 4) $search = FileFindFirstFile($aArray) While 1 $file = FileFindNextFile($search) If @error Then ExitLoop Run("C:\Program Files (x86)\Adobe\Adobe Flash CS5.5\flash.exe $sAutoItDir\" & $file) $file = StringTrimRight($file, 4) WinWaitActive($file) ; send export command Send("^m") WinWaitActive("Export Movie") [b]; set filepath to open file's directory and name Send("C:\tmp\" & $file & ".Mov")[/b] Send("{ENTER}") WinWaitActive("QuickTime Export Settings") ; dismiss export settings dialg Send("{ENTER}") WinWaitActive("Adobe Flash CS5.5") ; dismiss export settings dialg Send("{ENTER}") ; if you're not using MX 2004 Pro, edit the following line to match the Window title of your version WinWaitActive($file) ; close .fla file Send("^!x") ;Send("n") WEnd ; Close the search handle FileClose($search) I've also highlighted in bold my problem with using subdirectories, I'm not sure how to tell the mov to be rendered out the folder the file came from, in javascript I've used thelastIndexOf function to trim the directory, I see the StringTrimRight function removed the extension from the $file, but because every filename will have a different length I knew I couldn't use the same function to set a filepath Any help would be greatly appreciated