I had a working script which I wanted to adapt. It iteratively reads each line in a txt file and runs a send command for each line.
working script
Code: Select all
Loop, Read, C:\Users\JK\18-reports PDFs\id.txt
IDArr%A_Index%:= RegExReplace(A_LoopReadLine, "\D")
While % IDArr%A_index%
send % "FileCopy, C:\Users\JK\18-reports PDFs\" IDArr%A_index% "`n"
I want to adapt this code to run another code for each line in the id.txt file.
After it finishes running the script it moves to the next line in id.txt file and reruns the script for that line.
attempted code which doesn't seem to be working
Code: Select all
SetKeyDelay, -1
SetTitleMatchMode, 2
winTitle := "Custom Filter - Occurrence List - Q-Pulse"
winTitle2 := "LaunchPad <xxx,xxx>"
winClass := "ahk_class WindowsForms10.Window.8.app.0.2eed1ca_r9_ad1"
editControl := "WindowsForms10.EDIT.app.0.2eed1ca_r9_ad"
hWnd1 := WinExist(winTitle) ; Get Custom Filter window hWnd
hWnd2 := WinExist(winTitle2) ; Get LaunchPad window hWnd
ptrS := A_PtrSize ? "Ptr" : "UInt"
Loop, Read, C:\Users\JK\18-reports PDFs\id.txt
IDArr%A_Index%:= RegExReplace(A_LoopReadLine, "\D")
While % IDArr%A_index%
WinMinimizeAll
Sleep, 800
ControlClick, % editControl "11", % "ahk_id " hWnd1
Sleep, 100
Send, ^{end}
Sleep, 100
Send, ^+{home}
Sleep, 100
Sleep, 100
Send % "comp-"IDArr%A_index%
Send {Enter}
Sleep, 3000