Isoraqathedh

rename.ahk

Jun 24th, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. FormatTime, PrintMonth,, yyyy-MM
  2. MoveTo := "\\psf\Home\Desktop\Screenshots\" . PrintMonth
  3. FileMove \\psf\Home\Desktop\Screenshots\Screen Shot*.png, %MoveTo%
  4. SetWorkingDir \\psf\Home\Desktop\Screenshots\%PrintMonth%
  5. FileList =
  6. Loop, Screen Shot*.png
  7. {
  8.     TimeStamp := SubStr(A_LoopFileName, 21)
  9.     FileList = %FileList%%TimeStamp%`n
  10. }
  11. IfNotExist \\psf\Home\Desktop\Screenshots\%PrintMonth%
  12.     FileCreateDir \\psf\Home\Desktop\Screenshots\%PrintMonth%
  13. numFiles := 0, numFiles2 := 0
  14. Loop, parse, FileList, `n
  15. {
  16.     FileMove, \\psf\Home\Desktop\Screenshots\%PrintMonth%\Screen Shot %PrintMonth%-%A_LoopField%, \\psf\Home\Desktop\Screenshots\%PrintMonth%\%A_LoopField%
  17.     numFiles++
  18. }
  19. FileList =
  20. SetWorkingDir \\psf\Home\Downloads\Mover\
  21. Loop, *.???*
  22.     FileList = %FileList%%A_LoopFileName%`n
  23. IfNotExist \\psf\Home\Downloads\%PrintMonth%
  24.     FileCreateDir \\psf\Home\Downloads\%PrintMonth%
  25. Loop, parse, FileList, `n
  26. {
  27.     FileMove, \\psf\Home\Downloads\Mover\%A_LoopField%, \\psf\Home\Downloads\%PrintMonth%\%A_LoopField%
  28.     numFiles2++
  29. }
  30. if numFiles2 <> 0
  31.     numfiles2 -= 2
  32. if numFiles <> 0
  33.     numfiles -= 1
  34. FileDelete, %A_MyDocuments%\AHK Scripts\completed.txt
  35. FileAppend,
  36. (
  37. %numFiles% file(s) to Screenshots\%PrintMonth%\
  38. %numFiles2% file(s) to Downloads\%PrintMonth%\
  39. ), %A_MyDocuments%\AHK Scripts\completed.txt
Advertisement
Add Comment
Please, Sign In to add comment