I'd like to scan a QR code or barcode with a scanner, which then opens a folder with the matching order number.
Currently, I'm trying a slightly modified version of the script in the linked thread above. In the GUI, I scan a QR or barcode, and the folder matching the "%pdfname%" opens up. This seems to work well, but it doesn't seem to search any subfolders. Many folders I'm looking for are stored 2 to 4 subfolders inside the "E:\Printer PC Shared Folder\". How can I edit this to search all subfolders?
Code: Select all
SetTitleMatchMode 2
Gui, +alwaysontop ;keeps the gui on top level
Gui, Add, Edit , w200 vpdfname,
Gui, Add, Button, gopenpdf default , OPEN
Gui, show ,, scantopdf ;give name to gui for later reference
return
openpdf:
Gui,Submit,Nohide
If (pdfname = "" )
{
ControlFocus
return
}
Loop, Files, E:\Printer PC Shared Folder\*, D
If A_LoopFileName contains %pdfname%
Run %A_LoopFileFullPath%
WinActivate
Guicontrol,,pdfname, ;makes the edit box blank
sleep 4000 ;wait 4 seconds for pdf to load
WinActivate,scantopdf ;then reactivate the gui window
return
Exit:
GuiClose:
ExitApp