Guest
Public paste!

Untitled

By: a guest | Feb 9th, 2010 | Syntax: AutoIt | Size: 0.87 KB | Hits: 14 | Expires: Never
This paste has a previous version, view the difference. Copy text to clipboard
  1.   {
  2.       LV_GetText(FullFileName, A_Index, 1)
  3.       LV_GetText(FullFilePath, A_Index, 2)
  4.       If BatchButton
  5.           Gosub, BatchRename
  6.       Else
  7.           Gosub, RenameFile
  8.       OldFilePath:=FullFilePath "\" FullFileName
  9.       NewFilePath:=FullFilePath "\" NewName
  10.       If !(OldFilePath == NewFilePath)
  11.         {
  12.                   If (OldFilePath != NewFilePath) && FileExist(NewFilePath)
  13.                     {
  14.                           SplitPath, NewName,,, FileExt, FileName
  15.                       Loop
  16.                             {
  17.                               NewFilePath := FullFilePath "\" FileName "_" A_Index "." FileExt
  18.                                   IfNotExist, %NewFilePath%
  19.                                     Break
  20.                             }
  21.                         }
  22.           FileMove, %OldFilePath%, %NewFilePath%
  23.           LV_Modify(A_Index, "", NewName, FullFilePath)
  24.           NumOfFilesRenamed++
  25.         }
  26.           BackupRename := (BackupRename) ? (BackupRename "`n" NewFilePath ">" OldFilePath) : (NewFilePath ">" OldFilePath)
  27.     }