jeeswg's Acc tutorial (Microsoft Active Accessibility) (MSAA)

Helpful script writing tricks and HowTo's
Descolada
Posts: 1077
Joined: 23 Dec 2021, 02:30

Re: jeeswg's Acc tutorial (Microsoft Active Accessibility) (MSAA)

Post by Descolada » 12 Oct 2022, 23:03

@dbareis, usually not being able to access the content/document of Chrome, it means that accessibility isn't turned on. You can make sure of that by either running the browser with --force-renderer-accessibility flag (eg chrome.exe --force-renderer-accessibility) or use navigate to chrome://accessibility/ and check all the boxes there.

You can also do that programmatically by sending the WM_GETOBJECT message to Chrome with SendMessage, WM_GETOBJECT := 0x003D, 0, 1, Chrome_RenderWidgetHostHWND1, ahk_exe chrome.exe and then also accessing the document elements' accName(0).

dbareis
Posts: 39
Joined: 04 Feb 2022, 17:57

Re: jeeswg's Acc tutorial (Microsoft Active Accessibility) (MSAA)

Post by dbareis » 13 Oct 2022, 18:23

Descolada wrote:
12 Oct 2022, 23:03
@dbareis, usually not being able to access the content/document of Chrome, it means that accessibility isn't turned on. You can make sure of that by either running the browser with --force-renderer-accessibility flag (eg chrome.exe --force-renderer-accessibility) or use navigate to chrome://accessibility/ and check all the boxes there.

You can also do that programmatically by sending the WM_GETOBJECT message to Chrome with SendMessage, WM_GETOBJECT := 0x003D, 0, 1, Chrome_RenderWidgetHostHWND1, ahk_exe chrome.exe and then also accessing the document elements' accName(0).
Hi @Descolada, Thanks, Accessability is definitely the correct area, that page appears to be very buggy but "Text metrics" was initially not selected. Selecting it made things work as did deselecting it afterwards. I left it selected but if I "chrome://restart" it seems to deselect some or all of the flags randomly. Anyway, I will play with this and hopefully after my next restart of the laptop it still works or I will google your proposed "Chrome_RenderWidgetHostHWND1" solution for someone's code.

[UPDATE] Looks like I will need to set accessibility up every time I start for some reason.

LAPIII
Posts: 667
Joined: 01 Aug 2021, 06:01

Re: jeeswg's Acc tutorial (Microsoft Active Accessibility) (MSAA)

Post by LAPIII » 25 Jan 2023, 14:57

Where do you get the JEE_AccGetTextAll function? Can you help me add it to:

Code: Select all

#Include <Acc>

q:: ;get text and Acc paths for GUI elements
WinGet, hWnd, ID, A
Clipboard := JEE_AccGetTextAll(hWnd, "`r`n")
MsgBox, % "done"
return

User avatar
boiler
Posts: 16705
Joined: 21 Dec 2014, 02:44

Re: jeeswg's Acc tutorial (Microsoft Active Accessibility) (MSAA)

Post by boiler » 25 Jan 2023, 21:13

See the first post of the thread. To add it to your script, copy it, then paste it into your script.

Post Reply

Return to “Tutorials (v1)”