v2-beta.1 UIAutomation class wrapper

Post your working scripts, libraries and tools.
User avatar
thqby
Posts: 407
Joined: 16 Apr 2021, 11:18
Contact:

v2-beta.1 UIAutomation class wrapper

25 Sep 2021, 09:28

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
Last edited by thqby on 04 Oct 2021, 01:34, edited 1 time in total.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: v2-beta.1 UIAutomation class wrapper

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
iseahound
Posts: 1445
Joined: 13 Aug 2016, 21:04
Contact:

Re: v2-beta.1 UIAutomation class wrapper

25 Sep 2021, 16:12

Nice project! Do you have any test scripts?

@swagfag
I think thqby wants the name of the calling function. OSError(some_error, -2)
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: v2-beta.1 UIAutomation class wrapper

25 Sep 2021, 16:38

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)
User avatar
thqby
Posts: 407
Joined: 16 Apr 2021, 11:18
Contact:

Re: v2-beta.1 UIAutomation class wrapper

26 Sep 2021, 08:50

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.
Last edited by thqby on 26 Sep 2021, 08:58, edited 1 time in total.
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: v2-beta.1 UIAutomation class wrapper

26 Sep 2021, 08:56

alright, cool, the lib is super good otherwise

Return to “Scripts and Functions (v2)”

Who is online

Users browsing this forum: jacek678 and 57 guests