Jump to content
Sign in to follow this  

Rename files!? in order

Recommended Posts

I tried use Fraps in order to make a timelapse. There's a setting where I can make it shoot a screenshot every chosen second. For this time I used every 3rd second to shoot a screenshot.

Then I will use Vegas to import these as image sequences.

And here's a screenshot on the problem: http://prntscr.com/35mwe1

Problem is simply that Fraps are naming those files as the window title (the game in this case) AND date+time.

Vegas doesn't recognize the order somehow and therefor I can't make timelapse out of it.


I can fix this manually by just naming all the files in order, to something like File_0001, File_0002, File_0003 and so on. This of course will take loads of time when I have houndreds of images.


Therefor I wonder if there's any script out there, that can help me? Or atleast if you may say if this is possible using AutoIT? or however I do this?

The images in the folder is in order, and I can just order them by name and it will be fine. However vegas seems not to be able to make this a sequence even though windows 7 that I use, can do it.

Tips of how I can do?

Share this post

Link to post
Share on other sites


As JohnOne said,  _FileListToArray is going to help you alot.

      I had a similar issue sorting and renaming images. The problem I was running into was let's say, you have 30 images and they are numbered some thing like this 1.jpg, 2.jpg, 3.jpg, through 30.jpg. When you use _FileListToArray, and then sort them. The array will get sorted like this.


It will sort by the first number and then the number beside of that number. That's why you see 1.jpg and then 10.jpg instead of 1,2,3, and so on.

DW1 provided me a really nice _Sort Function that worked perfect for me and you may want to give it a try. I'm not sure how your naming your images, but if they are numbered like above, this works great.

Edited by RickB75

Share this post

Link to post
Share on other sites

Check this

$Dir = "X:\XXXXX" ; Write here the folder
$search = FileChangeDir($Dir)
$filetype = "jpg" ; the type of the files to rename
$search = FileFindFirstFile("*."&$filetype)
$filename = "file_" ; the naming for the files. change it if you want
$n = DirGetSize($Dir,1)

For $i = 1 to $n[1]
    $file = FileFindNextFile($search)
    If @error Then ExitLoop
    FileMove($Dir & "\" & $file, $Dir & "\" & $filename & $i & "." & $filetype)
But first make a backup folder.
You maybe need it
Edited by Guest

Share this post

Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...