Code: Select all
; Get the report text from the active window's control
ControlGetText, report_text, %control_name%, A
; Select the current line of text where the cursor is located
SendInput, +{Home}
; Copy the selected line to the clipboard
SendInput, ^c
ClipWait
Sleep, 30
; Move the cursor to the end of the line
SendInput, {Right}
; Get the copied line from the clipboard
line_text := Clipboard
This works as expected but if the line contains no characters the +{home} step produces a Windows error. Is there a way I can copy a null string, or otherwise avoid interrupting the code?