dipstick5000 wrote: ↑24 Jan 2020, 05:42
But if that's true why would the message box tell me it's about to use the proper file, not the first one? I guess that's happening in the line before the file copy, so I suppose... I don't know, I'll play around with A_LoopFilePath. Thank you for the idea.
Friend, your code is very clear in this; when you use the command MsgBox, you use variables that reference the specific file active in the loop:
Code: Select all
About to copy sound named "%A_LoopFileName%"
New name will be "%counter%.%A_LoopFileExt%"
But, when you use the FileCopy command, you are calling another reference, to the list of files where you start the loop:
Code: Select all
FileCopy, C:\2 sounds\*.mp3, C:\2 sounds copied\%counter%.%A_LoopFileExt%
FileCopy will do either; copy all .mp3 files in that reference and stack them elsewhere with the same filename (because you make destination so), meaning you end up with one file copied (the last on the folder), or just pick the first file in that reference and copy it to destination.
And since the Filecopy command always uses the same origin reference that doesn't specify 1 file, you will end up with the same file copied many times.
The correct way to do it is using
Code: Select all
FileCopy, C:\2 sounds\%A_LoopFileName%.%A_LoopFileExt%, C:\2 sounds copied\%counter%.%A_LoopFileExt%
Let me show you with a very simple but rude code draft:
You did this:
Code: Select all
Loop item in original-List
{
filecopy original-list onto destination-item
}
When you should have done this:
Code: Select all
Loop item in original-List
{
filecopy item onto destination-item
}
Cheers.