Parsing two variables into form Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
fabionnn
Posts: 2
Joined: 13 Aug 2022, 16:18

Parsing two variables into form

Post by fabionnn » 13 Aug 2022, 16:37

Hello community

I was trying to automate the extraction of patient data from a form in a program. The interface is shown on the attached images. I have a list of patient IDs and patient exam dates; For each patient, I have the date of the examination; however, I can't parse both variables (Date of Examination and Patient ID) into the form. Can someone help out? I've attached the code for parsing the date of the exam (I've been adding the patient ID by hand, but there must be a better way).
Thank you!



Patient ID Exam Date
123 01/06/2015
124 12/15/2010
125 06/20/2012

Code: Select all

Date=
(
01/06/2015
12/15/2010
06/20/2012
)

Loop, parse, Date, `n,`r
{

; Go to form

MouseMove, 72, 85
MouseClick, left

; Add 1st exam date

SendRaw, %A_LoopField%
Sleep, 100

; Switch to the 2nd field for date

Send {Tab}
Sleep, 100

Send {Tab}
Sleep, 100

SendRaw, %A_LoopField%

; [b]how can I now add the patient ID corresponding to the first exam date?[/b]


Attachments
complete form.png
Filled form
complete form.png (42.74 KiB) Viewed 299 times
empty form.png
Form to fill
empty form.png (39.2 KiB) Viewed 299 times

User avatar
mikeyww
Posts: 26881
Joined: 09 Sep 2014, 18:38

Re: Parsing two variables into form  Topic is solved

Post by mikeyww » 13 Aug 2022, 17:05

Welcome to this AutoHotkey forum!

Code: Select all

file = %A_ScriptDir%\dates.txt
If !FileExist(file) {
 MsgBox, 48, Error, File not found.`n`n%file%
 Return
}
Loop, Read, %file%
{ If (A_Index = 1)
   Continue
  part := StrSplit(A_LoopReadLine, " ")
  MsgBox, 64, Get ready, Click OK when ready.
  Click, 72 85
  SendInput % "{Text}" part.2 "`t" part.2 "`t" part.1
}
MsgBox, 64, Done, Done!
Attachments
dates.txt
Text file
(68 Bytes) Downloaded 8 times

Post Reply

Return to “Ask for Help (v1)”