crabboy Posted December 5, 2014 Share Posted December 5, 2014 Hello, im trying to write a script that will go through a folder, pick out the JPEG's and then resize them changing the name to "BACKUP"originalname.jpg. Im using a DOS command to give me a superdirlist, THE PROBLEM IS... it is only running through this sequence once but on that one go its working fine. So its only re-sizing one image. here is my script so far: (ill just include the part i think there is a problem with but let me know if any more would help) $file = "E:ImageResizeNEWsuperdirlist.txt" For $i = 1 to _FileCountLines($file) $line = FileReadLine($file, $i) FileClose($hFileOpen) Local $filename = StringSplit($line, "") For $i = 1 To $filename[0] ; Loop through the array returned by StringSplit to display the individual values. $doescontain = StringInStr($filename[$i], ".jpg") If $doescontain <> 0 Then MsgBox($MB_SYSTEMMODAL, "", "$filename[" & $i & "] - " & $filename[$i]) EndIf Next Here is the contents of my superdirlist.txt: E:ImageResizeNEW20140316_162236.jpg E:ImageResizeNEW20140316_162246.jpg E:ImageResizeNEWFolder E:ImageResizeNEWsuperdirlist.txt E:ImageResizeNEWFolder20140406_142320.jpg THANK YOU!!!!! Link to comment Share on other sites More sharing options...
Solution JohnOne Posted December 5, 2014 Solution Share Posted December 5, 2014 First of all, get rid of all of that code. Look up _FileListToArrayRec in help file. It will return an array of all .jpg files in your folder and subfolders. You then loop through it and do whatever it is you do with them. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
crabboy Posted December 5, 2014 Author Share Posted December 5, 2014 Thank you John that will save lots of time! 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