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

Helpful script writing tricks and HowTo's
julesverne
Posts: 13
Joined: 18 Apr 2017, 14:39
GitHub: JulesverneOnGitHub

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

03 Aug 2019, 13:10

I'm not sure how, but I figured it out, it's working. I think the biggest hurdle I faced was where you were coming up with the ACCpath numbers (using your Notepad example I was finally able to understand). A couple things I couldn't figure out still was how does a child path work into the function below, in addition what is parameter 3 and is it always 0?

Code: Select all

oAcc := Acc_Get("Object", "1.30", 0, "ahk_id " hCtl)
Also, thanks again! Acc Rules!!
User avatar
jeeswg
Posts: 6649
Joined: 19 Dec 2016, 01:58
Location: UK

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

03 Aug 2019, 13:45

- Acc_Get's ChildID parameter is sometimes used to specify a subitem, e.g. 0 for the listview, a positive integer for a specific listview item.
- I use JEE_AccGetTextAll to determine Acc_Get's ChildPath parameter, it may also be possible to derive this via AccViewer's status bar. Each number in the path refers to the nth child of an object.
- Btw do always try AHK's window spy first, some things can be done via ClassNNs and ControlGetText/other ControlXXX commands/functions. [EDIT: I've added some text re. the Acc path and re. controls to the first post of this thread.]
Last edited by jeeswg on 16 Aug 2019, 13:17, edited 1 time in total.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
blue83
Posts: 41
Joined: 11 Apr 2018, 06:38

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

06 Aug 2019, 02:56

Hi jeeswg,

I can not get "JEE_AccGetTextAll" to work.

Can you give me an example of a script with some app.

Dont know what to include, how to do it in a way that at the end MsgBox show me what it should.

Thank you.
User avatar
jeeswg
Posts: 6649
Joined: 19 Dec 2016, 01:58
Location: UK

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

10 Aug 2019, 18:06

Some pointers on using JEE_AccGetTextAll.
Note: it can be quite slow, because there may be a lot of GUI elements to loop through.
I generally use it for diagnostic purposes to get info on a window, and typically use Acc_Get in everyday scripts.

Code: Select all

;add an #Include line e.g.:
;#Include Acc.ahk
;#Include C:\MyDir\Acc.ahk

;or don't use #Include, but instead:
;copy Acc.ahk to an appropriate Lib folder:
;Functions - Definition & Usage | AutoHotkey
;https://www.autohotkey.com/docs/Functions.htm#lib
;%A_ScriptDir%\Lib\  ; Local library - requires [v1.0.90+].
;%A_MyDocuments%\AutoHotkey\Lib\  ; User library.
;directory-of-the-currently-running-AutoHotkey.exe\Lib\  ; Standard library.

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

;paste the 'JEE_AccGetTextAll' function somewhere in the script
;(it can be above or below the code where it's used)
;available at these 2 links:
;GUIs via DllCall: get/set internal/external control text - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=40514
;Acc: get text from all window/control elements - AutoHotkey Community
;https://autohotkey.com/boards/viewtopic.php?f=6&t=40615
;JEE_AccGetTextAll(...)
;{
;...
;}
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
blue83
Posts: 41
Joined: 11 Apr 2018, 06:38

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

12 Aug 2019, 01:58

Hi jeeswg,

Yes ofcourse, you just open my eyes, I was so close to final result.

Thank you on clarification.

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 2 guests