# script opens Notepad, types some text there and gets text in WR variables in different ways, and prints out in debug window invoke_application("notepad.exe","","C:\\",SW_SHOW); # open Notepad # set window (physical description there and further is used to to not use GUI file) set_window ("{class: window, label: \"Untitled - Notepad\", MSW_class: Notepad}"); edit_set ("{class: edit}","Abracadabra"); # type text in edit edit box # simple and fast way: edit_get_text("{class: edit}",str); # - get text from text box element property # more expensive way, reads screen as a bitmap, and recognozes text using OCR: # - from notepad window win_get_text ("{class: window, label: \"Untitled - Notepad\", MSW_class: Notepad}",ocr_str,5,45,100,60); ocr_garbage = get_text (0,0,800,600); # - from any part of the screen print "Simple string from edit field:"str; # print on WR debug window print "OCR from Notepad window:"ocr_str; print "OCR garbage from screen:"ocr_garbage; wait(5); # have a fun with results type ("-+"); # close Notepad using Alt+F4 # confirm change losing set_window ("{class: window,label: Notepad}", 10); button_press ("{class: push_button, label: No}");