123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
-
-
-
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input
- SetWorkingDir %A_ScriptDir%
- ImageFileList = Image List - Used.txt
- UsedImageFolder = Images, Used
- UnUsedImageFolder = Images, Un-Used
- SourceFolder = images
- FileEncoding, UTF-16
- IfNotExist %ImageFileList%
- {
- MsgBox, 16, Move Image Files, Unable to locate "%ImageFileList%" in "%A_WorkingDir%", 10
- Exit
- }
- IfNotExist %UsedImageFolder%
- {
- FileCreateDir, %UsedImageFolder%
- }
- IfNotExist %UnUsedImageFolder%
- {
- FileCreateDir, %UnUsedImageFolder%
- }
- FileRead, Images, %ImageFileList%
- Images := StrReplace(Images, "/", "\")
- Loop, Parse, Images, `n, `r
- {
- if trim(A_LoopField) = ""
- continue
-
- IfExist, %A_LoopField%
- {
-
- SplitPath, A_LoopField, FileName, FileDir
- IfNotExist %UsedImageFolder%\%FileDir%
- {
- FileCreateDir, %UsedImageFolder%\%FileDir%
- if (ErrorLevel)
- {
- MsgBox, 48, Move Image File, FileCreateDir Error:`n`nFailed to create '%UsedImageFolder%\%FileDir%'`n`nErrorLevel: '%ErrorLevel%'`nLastError: '%A_LastError%'
- }
- }
-
-
- FileMove, %A_LoopField%, %UsedImageFolder%\%FileDir%
- if (ErrorLevel)
- {
- MsgBox, 48, Move Image File, FileMove Error:`n`nFailed to move '%A_LoopField%' to '%UsedImageFolder%\%FileDir%'`n`nErrorLevel: '%ErrorLevel%'`nLastError: '%A_LastError%'
- }
- }
- else
- {
- MsgBox, 64, Move Image Files, Unable to locate file : '%A_LoopField%', 5
- }
- }
- IfExist %SourceFolder%
- {
- FileMoveDir, %SourceFolder%, %UnUsedImageFolder%\%SourceFolder%
- if (ErrorLevel)
- {
- MsgBox, 48, Move Image File, FileMoveDir Error:`n`nFailed to move '%SourceFolder%' to '%UnUsedImageFolder%\%SourceFolder%'`n`nErrorLevel: '%ErrorLevel%'`nLastError: '%A_LastError%'
- }
-
-
- else IfNotExist %SourceFolder%
- {
- FileMoveDir, %UsedImageFolder%\%SourceFolder%, %SourceFolder%
- if (ErrorLevel)
- {
- MsgBox, 48, Move Image File, FileMoveDir Error:`n`nFailed to move '%UsedImageFolder%\%SourceFolder%' to '%SourceFolder%'`n`nErrorLevel: '%ErrorLevel%'`nLastError: '%A_LastError%'
- }
- else
- {
- FileRemoveDir, %UsedImageFolder%, 0
- }
- }
- }
|