I'm currently using a simple ahk to move scanned files into a different folder for processing.
Code: Select all
FolderSource = \\SVR1\SCAN\*.*
FolderTarget = \\SVR2\InProcess\*.*
Loop
{
FileMove, %FolderSource%, %FolderTarget%
sleep, 500
}
I'm working on splitting them into smaller 10 page PDFs, and then I'd like to move each of the files to a processing folder, one by one, after each one is processed.
When I say "processed", I mean the program I'm using moves that file to another folder with and gives it a random name with a .queued extension. The program then creates a folder with the same name as the random file, then deletes that .queued file. After that folder is processed, it gets shipped off to somewhere I'm not privy to, but at that point I'd like to start on the next file.
So, say I scan a 55 page document, then a 20 page document. I'll end up with 2 PDF files with YYYYMMDDHH24MISSMSS.pdf names. I'm going to split them using A-PDF, so i'll end up with something like
20170727180840313.0001.pdf through 20170727180840313.0006.pdf and
20170727180803373.0001.pdf through 20170727180803373.0002.pdf.
e.g. \\SVR1\SCAN\SPLIT\20170727180840313.0001.pdf gets created, then it needs to move to another folder (say \\SVR2\InProcess\) where it will get named 1.b47e3e3d-fd1d-445d-98bf-901abbba5ecc.scan.inbound.queued and soon after a folder will be created in that same directory with the same name as the file minus the 1. and .queued (b47e3e3d-fd1d-445d-98bf-901abbba5ecc). Soon after that, the .queued file gets deleted, and the b47e3e3d-fd1d-445d-98bf-901abbba5ecc folder stays around for a minute or so and gets processed. Then the b47e3e3d-fd1d-445d-98bf-901abbba5ecc folder disappears. At that point, I'd like \\SVR1\SCAN\SPLIT\20170727180840313.0002.pdf to move to \\SVR2\InProcess\
I guess to simplify things, I just want to copy the PDFs over when there doesn't exist FOLDERNAME, where FOLDERNAME is derived from 1.FOLDERNAME.scan.queued. There is other action in this folder, though-- similarly named folders are getting created from similarly named files, but those files are not .queued files, so at least I have that to go on.