Skip to content

Instantly share code, notes, and snippets.

@tsaiid
Created January 19, 2018 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsaiid/da4ba91d8c4b72db1d3b6b7280e0351d to your computer and use it in GitHub Desktop.
Save tsaiid/da4ba91d8c4b72db1d3b6b7280e0351d to your computer and use it in GitHub Desktop.
; Copy Current Helios Report Into Notepad
CopyHeliosReportIntoNotepad() {
WinGet, hWnd, ID, Helios
If (hWnd) {
; parse exam info
infoText := Acc_Get("Name", "4.5.1.1", 0, "ahk_id " hWnd)
RegExMatch(infoText, "^\[.+\]\s+(\w+)/([^\s]+)\s+\[(.+?)\]\s+\[.+?\]\s+\[(.+?)/.+?\]\s+\[([\d-]+).+?\]", examInfo)
ptID := examInfo1
ptName := examInfo2
ptSexAge := examInfo3
examName := examInfo4
examDate := examInfo5
findingText := Acc_Get("Value", "4.9.30.1", 0, "ahk_id " hWnd)
impText := Acc_Get("Value", "4.9.33", 0, "ahk_id " hWnd)
; windows styly newline
findingText := RegExReplace(findingText, "(?<!\r)\n", "`r`n")
impText := RegExReplace(impText, "(?<!\r)\n", "`r`n")
finalText = %ptID% %ptName% %ptSexAge% %examDate% %examName%`r`n`r`n----`r`n%findingText%`r`n`r`n====`r`n%impText%
Clipboard := finalText
Run, Notepad.exe, , , notepadPID
WinWait, ahk_pid %notepadPID%
WinActivate
SendEvent, ^v
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment