Page 1 of 1

v2-beta.1 UIAutomation class wrapper

Posted: 25 Sep 2021, 09:28
by thqby
UI Automation provides programmatic access to most user interface (UI) elements on the desktop, enabling assistive technology products such as screen readers to provide information about the UI to end users and to manipulate the UI by means other than standard input. UI Automation also allows automated test scripts to interact with the UI.

This is UI Automation class-wrapped for ahkv2-beta.1.
Download on GitHub

Re: v2-beta.1 UIAutomation class wrapper

Posted: 25 Sep 2021, 11:38
by swagfag
cool, this will be super useful

but why is everything wrapped in some UiError function? ComCall would already throw if there was an error

Re: v2-beta.1 UIAutomation class wrapper

Posted: 25 Sep 2021, 16:12
by iseahound
Nice project! Do you have any test scripts?

@swagfag
I think thqby wants the name of the calling function. OSError(some_error, -2)

Re: v2-beta.1 UIAutomation class wrapper

Posted: 25 Sep 2021, 16:38
by swagfag
swagfag wrote:
25 Sep 2021, 11:38
ComCall would already throw if there was an error
so it wouldnt even be able to get to run that function
he needs something like

Code: Select all

MyComCall(Args*) {
	try
		return ComCall(Args*)
	catch Error as E
	{
		ErrorType := %Type(E)%
		throw ErrorType((ErrorType is OSError) ? E.Number : E.Message, -2, E.Extra)
	}
}
it more plausible that this was copypasted from somewhere that already had this wrapper in place...
in which case * @author thqby probly needs a revision or two(not to diminish ur accomplishments, but lets not kid ourselves)

Re: v2-beta.1 UIAutomation class wrapper

Posted: 26 Sep 2021, 08:50
by thqby
swagfag wrote:
25 Sep 2021, 11:38
cool, this will be super useful

but why is everything wrapped in some UiError function? ComCall would already throw if there was an error
Oh, My idea is to show the cause of the error and the caller, but I forgot that comcall already throw.

And thank you for your warning.
It based on neptercn's UIA2, and I added a few extra interfaces and tweaked some.

Re: v2-beta.1 UIAutomation class wrapper

Posted: 26 Sep 2021, 08:56
by swagfag
alright, cool, the lib is super good otherwise