Page 2 of 2

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

Posted: 03 Aug 2019, 13:10
by julesverne
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!!

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

Posted: 03 Aug 2019, 13:45
by jeeswg
- 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.]

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

Posted: 06 Aug 2019, 02:56
by blue83
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.

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

Posted: 10 Aug 2019, 18:06
by jeeswg
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
;%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"

;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
;Acc: get text from all window/control elements - AutoHotkey Community

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

Posted: 12 Aug 2019, 01:58
by blue83
Hi jeeswg,

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

Thank you on clarification.