Dear LarsJ,
Your UIASpy tool and related examples are simply amazing.
I was struggling for months to automate WindowsForms10 and other types of applications that resist to classic AutoIt and this helps me a lot.
UI Automation is like the "missing chapter" of AutoIt, and I am very excited to see that it starts to take a functional form.
I think this example can be considered even more classic because it does not contain any other UDFs:
; open Notepad
Run ( "Notepad.exe" )
; wait for Notepad window to exist
Local $hNotepad = WinWait ( "[CLASS:Notepad; TITLE:Untitled - Notepad;]" )
; write "HelloWorld"
ControlSetText ( $hNotepad, "", "[CLASS:Edit; INSTANCE:1]", "HelloWorld" )
; open the SaveAs window (by pressing ALT+f and a)
ControlSend ( $hNotepad, "", "", "{ALT}fa" )
; wait for Save As window to exist
Local $hSaveAs = WinWait ( "[CLASS:#32770; TITLE:Save As;]" )
; complete the File Name field with "HelloWorld.txt"
ControlSetText ( $hSaveAs, "", "[CLASS:Edit; INSTANCE:1]", "HelloWorld.txt" )
; press the Save button
ControlClick ( $hSaveAs, "", "[CLASS:Button; INSTANCE:2]" )
; wait for Save As window to close
WinWaitClose ( $hSaveAs, "" )
; close the Notepad window
WinClose ( $hNotepad, "" )
; wait for Notepad window to close
WinWaitClose ( $hNotepad, "" )
Thank you!
Best regards,
AtomicSeek