Jump to content

Script for finding all JPEG's in all subfolders of dir.


crabboy
 Share

Go to solution Solved by JohnOne,

Recommended Posts

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

  • Solution

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

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...