; SOTA
IfWinNotExist , Home - Secure One-Time Authentication (SOTA)
{
MsgBox Your are not logged into SOTA. Please Log in and Try again.
Return
}
Else IfWinExist , Home - Secure One-Time Authentication (SOTA)
{
WinWait, Home - Secure One-Time Authentication (SOTA) - Microsoft Internet Explorer,
IfWinNotActive, Home - Secure One-Time Authentication (SOTA) - Microsoft Internet Explorer, , WinActivate, Home - Secure One-Time Authentication (SOTA) - Microsoft Internet Explorer,
WinWaitActive, Home - Secure One-Time Authentication (SOTA) - Microsoft Internet Explorer,
MouseClick, left, 373, 14
Sleep, 100
MouseClick, left, 312, 13
Sleep, 100
MouseClick, left, 20, 155
Sleep, 100
Send , {CTRLDOWN}a{CTRLUP}{CTRLDOWN}c{CTRLUP}
MouseClick, left, 20, 155
MouseClick, left, 20, 155
Sleep, 100
SOTAInfo := clipboard
ParseSOTA2()
FileCreateDir , H:\xxx\AHK Reflections\AHKs\SOTA
FileDelete , H:\xxx\AHK Reflections\AHKs\SOTA\SOTAFile.txt
; Employee Name
EmpName := "x" EmpName ; preserve leading spaces by adding non-space char
EmpName = %EmpName% ; relies on "autotrim" to remove leading/trailing white-space
StringTrimLeft, EmpName, EmpName, 1 ; remove added character
FileAppend , %EmpName%`n , H:\xxx\AHK Reflections\AHKs\SOTA\SOTAFile.txt ; 1
; Employee ID
EmpID := "x" EmpID ; preserve leading spaces by adding non-space char
EmpID = %EmpID% ; relies on "autotrim" to remove leading/trailing white-space
StringTrimLeft, EmpID, EmpID, 1 ; remove added character
FileAppend , %EmpID%`n , H:\xxx\AHK Reflections\AHKs\SOTA\SOTAFile.txt ; 1
; Employee Phone
String2 := EmpPhone
StringLeft, OutputVar3, String2, 3 ; Stores the string "First 3 digits of String" in OutputVar3.
StringRight, OutputVar4, String2, 9 ; Stores the string "Last 9 digits of String" in OutputVar4.
OutputVar4 := "x" OutputVar4 ; preserve leading spaces by adding non-space char
OutputVar4 = %OutputVar4% ; relies on "autotrim" to remove leading/trailing white-space
StringTrimLeft, OutputVar4, OutputVar4, 1 ; remove added character
FileAppend , %OutputVar3%-%OutputVar4%`n , H:\xxx\AHK Reflections\AHKs\SOTA\SOTAFile.txt
; Employee AU
EmpAU := "x" EmpAU ; preserve leading spaces by adding non-space char
EmpAU = %EmpAU% ; relies on "autotrim" to remove leading/trailing white-space
StringTrimLeft, EmpAU, EmpAU, 1 ; remove added character
FileAppend , %EmpAU%`n , H:\xxx\AHK Reflections\AHKs\SOTA\SOTAFile.txt ; 1
; Date Stamp
String := EmpTimeStamp
StringLeft, OutputVar1, String, 10 ; Stores the string "First 10 digits of String" in OutputVar1.
StringRight, OutputVar2, String, 9 ; Stores the string "Last 8 digits of String" in OutputVar2.
FileAppend , %OutputVar1%`n , H:\xxx\AHK Reflections\AHKs\SOTA\SOTAFile.txt
;Time Stamp
OutputVar2 := "x" OutputVar2 ; preserve leading spaces by adding non-space char
OutputVar2 = %OutputVar2% ; relies on "autotrim" to remove leading/trailing white-space
StringTrimLeft, OutputVar2, OutputVar2, 1 ; remove added character
FileAppend , %OutputVar2%`n , H:\xxx\AHK Reflections\AHKs\SOTA\SOTAFile.txt
}
ParseSOTA2() {
Global
Loop , Parse , SOTAInfo , `n , `r
{
If A_Index < 14 ; Skip first 13 lines
Continue
If A_Index = 20 ; Skip line 20 (This word...)
Continue
If A_Index = 21 ; Skip line 21 (blank)
Continue
If A_Index = 22 ; Skip line 22 (Details)
Continue
If A_Index = 24 ; Name line, get name
StringTrimLeft , EmpName , A_LoopField , 5
If A_Index = 25 ; A# line, get A#
StringTrimLeft , EmpID , A_LoopField , 10
If A_Index = 27 ; Telephone
StringTrimLeft , EmpPhone , A_LoopField , 11
If A_Index = 28 ; AU
StringTrimLeft , EmpAU , A_LoopField , 3
If A_Index = 32 ; TimeStamp
StringTrimLeft , EmpTimeStamp , A_LoopField , 13
If A_Index > 38 ; Skip lines after 41
Continue
}
Return 1 ; Finish ParseSOTA
} ;-------------------------------------------------