I am tweaking a script which I got from https://www.autohotkey.com/boards/viewtopic.php?f=76&t=71180 Thanks @flyingDman for your help with this script:
After trying it nothing happens, the file is not moved to the subfolders. Perhaps I've overcooked it.
goal of script
Read ID numbers from id.text file located inside the source folder.
for each of these ID numbers it will go to the matching subfolder inside the destination.
It will copy the email file called investigation reports complete.msg into each of these subfolders
Code: Select all
sourcepath := " C:\Users\JK\Documents\reports PDFs"
destpath := " C:\Users\JK\Documents\cases\xxxx"
Loop, Files, investigation reports complete.msg
{
Loop, Read, C:\Users\JK\Documents\reports PDFs\id.txt
regexmatch(A_LoopReadLine,"(\d+)",match)
num := match1
filecopy, C:\Users\JK\Documents\reports PDFs\investigation reports complete.msg,% destpath . floor(num/100) "01 - " ceil(num/100) "00\" num "\" A_LoopFileName
}
return
Other things i tried
changed regexmatch to RegExReplace(A_LoopReadLine, "\d+",match)
changed num := match1 to num := match
Is there something simple I am missing here?
btw folder structure is like this C:\Users\JK\Documents\cases\2101 - 2200\2199