---------------------------
iWB2 Learner UPDATED.ahk
---------------------------
Error: Call to nonexistent function.
Specifically: Acc_ObjectFromPoint(child).accSelect(0x3, child)
Line#
112: temp := clipboard := %A_GuiControl%
113: ToolTip,"clipboard= " (StrLen(temp) > 40 ? SubStr(temp,1,40) "..." : temp)
114: SetTimer,RemoveToolTip,1000
115: }
116: Else
116: if (A_GuiControl = "TView")
116: {
---> 117: Acc_ObjectFromPoint(child).accSelect(0x3, child)
118: Hotkey,~LButton Up,On
120: if TV_GetParent(TVsel:=TV_GetSelection())
120: {
121: TV_GetText(text, TVsel)
122: RegExMatch(text, "\d+", child)
123: clicked := Stored.pelt.childNodes[child]
124: }
The program will exit.
---------------------------
Okey
---------------------------
Acc library (MSAA) and AccViewer download links
Re: Acc library (MSAA) and AccViewer download links
I have such a problem.
Re: Acc library (MSAA) and AccViewer download links
- 3 possible solutions:
- (1) Create a folder called 'Lib' (in the same folder as the AutoHotkey exe), and copy Acc.ahk and Anchor.ahk into that folder.
- (2) Edit 'iWB2 Learner UPDATED.ahk', add these 2 lines at the top (or bottom):
- (3) Edit 'iWB2 Learner UPDATED.ahk', add the contents of Acc.ahk and Anchor.ahk into it at the bottom (or top).
- (1) Create a folder called 'Lib' (in the same folder as the AutoHotkey exe), and copy Acc.ahk and Anchor.ahk into that folder.
- (2) Edit 'iWB2 Learner UPDATED.ahk', add these 2 lines at the top (or bottom):
Code: Select all
#Include %A_ScriptDir%\Acc.ahk
#Include %A_ScriptDir%\Anchor.ahk
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Acc library (MSAA) and AccViewer download links
Yeah, that worked. Thanks.jeeswg wrote: ↑11 Jun 2019, 21:37- 3 possible solutions:
- (1) Create a folder called 'Lib' (in the same folder as the AutoHotkey exe), and copy Acc.ahk and Anchor.ahk into that folder.
- (2) Edit 'iWB2 Learner UPDATED.ahk', add these 2 lines at the top (or bottom):- (3) Edit 'iWB2 Learner UPDATED.ahk', add the contents of Acc.ahk and Anchor.ahk into it at the bottom (or top).Code: Select all
#Include %A_ScriptDir%\Acc.ahk #Include %A_ScriptDir%\Anchor.ahk
Re: Acc library (MSAA) and AccViewer download links
There is a bug in AccViewer.
To recreate this bug You have to:
1) Install the next extension: in Chrome::::
https://chrome.google.com/webstore/detail/floating-for-youtube-exte/egncdnniomonjgpjbapalkckojhkfddk
2) Run Google Chrome with --force-renderer-accessibility flag.
3) Run any Youtube video in this extension.
If You run AccViewer to get object from floating-for-youtube window - You will get nothing.
If You run AccExplorer from MSDN - You will get object and path.
https://github.com/blackrosezy/gui-inspect-tool/blob/master/AccExplorer32.exe
To recreate this bug You have to:
1) Install the next extension: in Chrome::::
https://chrome.google.com/webstore/detail/floating-for-youtube-exte/egncdnniomonjgpjbapalkckojhkfddk
2) Run Google Chrome with --force-renderer-accessibility flag.
3) Run any Youtube video in this extension.
If You run AccViewer to get object from floating-for-youtube window - You will get nothing.
If You run AccExplorer from MSDN - You will get object and path.
https://github.com/blackrosezy/gui-inspect-tool/blob/master/AccExplorer32.exe
Re: Acc library (MSAA) and AccViewer download links
@malcev, thank you for linking to this tool!
Re: Acc library (MSAA) and AccViewer download links
There is a bug in your code.tmplinshi wrote: ↑10 Oct 2018, 15:57I made some changes to the AccViewer:https://gist.github.com/tmplinshi/0fcb8655c1402a3662ac048d0d974915
- Display all 'State' and its constant name/value
- Display constant name/value of 'Role'
- Changed the hotkey from "Ctrl+/" to "Ctrl+F12"
- Added 'HotTracking' checkbox
- Increased GUI Size
Open Chrome, navigate to any Youtube video, double click with right mouse button on it, choose "picture in picture".
Then try to get path of this "picture in picture youtube video".
Using Your tool - You will get "5".
But if You use original AccViewer, then You will get the right path - "4.1.5".
https://raw.githubusercontent.com/Drugoy/Autohotkey-scripts-.ahk/master/DevTools/AccViewer.ahk
Re: Acc library (MSAA) and AccViewer download links
@malcev I checked the original AccViewer that I have, it produce the same result as my modified version "5". The AccViewer.ahk you provide do produce "4.1.5".
So I compared the two versions, and found the reason to it.
Code produce path "5":
Code produce path "4.1.5":
The difference between the above two Acc_ObjectFromWindow functions:
I think this was an accident that someone made a replacement to 7 with %_offset1% .
So I compared the two versions, and found the reason to it.
Code produce path "5":
Code: Select all
Acc_ObjectFromWindow(hWnd, idObject = 0)
{
If DllCall("oleacc\AccessibleObjectFromWindow", "Ptr", hWnd, "UInt", idObject&=0xFFFFFFFF, "Ptr", -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x719B3800AA000C81,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,"Int64"),"Int64"), "Ptr*", pacc)=0
Return ComObjEnwrap(9,pacc,1)
}
Code: Select all
Acc_ObjectFromWindow(hWnd, idObject = 0)
{
Acc_Init()
If DllCall("oleacc\AccessibleObjectFromWindow", "Ptr", hWnd, "UInt", idObject&=0xFFFFFFFF, "Ptr", -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x%_offset1%19B3800AA000C81,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,"Int64"),"Int64"), "Ptr*", pacc)=0
Return ComObjEnwrap(9,pacc,1)
}
- 0x719B3800AA000C81
- 0x%_offset1%19B3800AA000C81
I think this was an accident that someone made a replacement to 7 with %_offset1% .
Re: Acc library (MSAA) and AccViewer download links
I do not think that it will be correct.
I do not understand why in this function:
we need this expression
If we remove it - code produce path "4.1.5".
And if We need to get object and path from Chrome We should rewrite GetAccPath and GetEnumIndex functions.
I do not understand why in this function:
Code: Select all
GetAccPath(Acc, byref hwnd="") {
hwnd := Acc_WindowFromObject(Acc)
WinObj := Acc_ObjectFromWindow(hwnd)
WinObjPos := Acc_Location(WinObj).pos
while Acc_WindowFromObject(Parent:=Acc_Parent(Acc)) = hwnd {
t2 := GetEnumIndex(Acc) "." t2
if Acc_Location(Parent).pos = WinObjPos
return {AccObj:Parent, Path:SubStr(t2,1,-1)}
Acc := Parent
}
while Acc_WindowFromObject(Parent:=Acc_Parent(WinObj)) = hwnd
t1.="P.", WinObj:=Parent
return {AccObj:Acc, Path:t1 SubStr(t2,1,-1)}
}
Code: Select all
if Acc_Location(Parent).pos = WinObjPos
return {AccObj:Parent, Path:SubStr(t2,1,-1)}
And if We need to get object and path from Chrome We should rewrite GetAccPath and GetEnumIndex functions.
Re: Acc library (MSAA) and AccViewer download links
There may be some ideas here re. alternative Acc functions (for Acc paths):
How to get the full ACC path for control on cursor? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=56470&p=254902#p254902
AccessibleObjectFromWindow does not execute method accFocus in Firefox - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=60278&p=254907#p254907
You could try this for getting Acc paths (JEE_AccGetTextAll):
Acc: get text from all window/control elements - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40615
@malcev: It would be helpful, after a while/after reflecting, when the picture is clearer, if you could summarise what problems you have seen with Acc.ahk and/or AccViewer, specifically problems with the versions in the AccPack zip. Thanks. [EDIT: Or you could create an alternative AccPack zip with proposed updated scripts.]
Thanks also for the great links re. YouTube and Acc alternatives. Much appreciated.
How to get the full ACC path for control on cursor? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=56470&p=254902#p254902
AccessibleObjectFromWindow does not execute method accFocus in Firefox - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=5&t=60278&p=254907#p254907
You could try this for getting Acc paths (JEE_AccGetTextAll):
Acc: get text from all window/control elements - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40615
@malcev: It would be helpful, after a while/after reflecting, when the picture is clearer, if you could summarise what problems you have seen with Acc.ahk and/or AccViewer, specifically problems with the versions in the AccPack zip. Thanks. [EDIT: Or you could create an alternative AccPack zip with proposed updated scripts.]
Thanks also for the great links re. YouTube and Acc alternatives. Much appreciated.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
Re: Acc library (MSAA) and AccViewer download links
There is an error in library from the first post link
There are some situations in Google Chrome when several parent objects have the same location as child object and how we can choose which one of them to take?
May be it will be better to get path of searched object with creating tree of all objects and comparing each object properties such as name, value, state, location... with our searched object properties?
[AccViewer.ahk]
Autohotkey-scripts-.ahk/AccViewer.ahk at master · Drugoy/Autohotkey-scripts-.ahk · GitHub
https://github.com/Drugoy/Autohotkey-scripts-.ahk/blob/master/DevTools/AccViewer.ahk
And I think that algorithm for getting path in AccViewer.ahk is wrong.If DllCall("oleacc\AccessibleObjectFromWindow", "Ptr", hWnd, "UInt", idObject&=0xFFFFFFFF, "Ptr", -VarSetCapacity(IID,16)+NumPut(idObject==0xFFFFFFF0?0x46000000000000C0:0x%_offset1%19B3800AA000C81,NumPut(idObject==0xFFFFFFF0?0x0000000000020400:0x11CF3C3D618736E0,IID,"Int64"),"Int64"), "Ptr*", pacc)=0
There are some situations in Google Chrome when several parent objects have the same location as child object and how we can choose which one of them to take?
May be it will be better to get path of searched object with creating tree of all objects and comparing each object properties such as name, value, state, location... with our searched object properties?
-
- Posts: 3
- Joined: 08 Jan 2020, 18:44
Re: Acc library (MSAA) and AccViewer download links
Hi,
I would like to know, how to use the acclocation, parent, children.
I have done something like
try vLocation := oAcc.accLocation(vChildID)
try vParent := oAcc.accParent(vChildID)
try vChildren := oAcc.accChildren(vChildID)
They have not succeeded in any of the applications.
Did I wrongly call the function or missunderstood it?
I would like to know, how to use the acclocation, parent, children.
I have done something like
try vLocation := oAcc.accLocation(vChildID)
try vParent := oAcc.accParent(vChildID)
try vChildren := oAcc.accChildren(vChildID)
They have not succeeded in any of the applications.
Did I wrongly call the function or missunderstood it?
Re: Acc library (MSAA) and AccViewer download links
Parsing Acc tree objects upwards proved to be tricky (tmplinshi's Acc Viewer & serzh82saratov's AhkSpy fail to yield correct path in some UI-s). So the idea is to parse downwards based on Get Acc children. Doing this got the idea of a new way for upward, but in the end wasn't any better then beforementioned (now completely commented out).
Issues: slower and for highly branched Acc like in IE may crashif there are a lots of tabs opened, probably due to Ahk recursive call limitation (ca 350 <---- [Edit]).
- Esc will stop the parsing
- s, d, f, e will move mouse cursor by one pixel to left (s), down (d), right (f) and up (e) - alongside w/ arrow keys
- ^\ starts framing elements w/o pressing LButton down, F3 stops it (evaluates current selection)
-pressing Ctrl before releasing LButton will use alternative parsing upwards (not for treeView)
P.s.: Very little tested, but looks promising.
P.p.s.:
1. Example of use if Path is not available (N/A).
2. Check box in browser.
Issues: slower and for highly branched Acc like in IE may crash
- Esc will stop the parsing
- s, d, f, e will move mouse cursor by one pixel to left (s), down (d), right (f) and up (e) - alongside w/ arrow keys
- ^\ starts framing elements w/o pressing LButton down, F3 stops it (evaluates current selection)
-
P.s.: Very little tested, but looks promising.
P.p.s.:
1. Example of use if Path is not available (N/A).
2. Check box in browser.
- Attachments
-
- Acc Viewer RP3.5.ahk
- (69.04 KiB) Downloaded 551 times
Last edited by rommmcek on 10 Apr 2021, 10:52, edited 3 times in total.
Re: Acc library (MSAA) and AccViewer download links
- Bug fixed (supplemented criteria to stop parsing the Acc tree).
- Thanks to malcev improved initializing of the Acc.
- In case of N/A for the AccPath all values are displayed so parent AccPath can be (empirically) found (not user friendly - To do: automate it...)
- Thanks to malcev improved initializing of the Acc.
- In case of N/A for the AccPath all values are displayed so parent AccPath can be (empirically) found (not user friendly - To do: automate it...)
Re: Acc library (MSAA) and AccViewer download links
I would like to publicly congratulate The developer of aac.ahk long library. Yours long development time can allow advanced programmer to even create screen reader by using Autohotkey. Sure, there are several freely available screen readers, but if somebody have a new invention on this field of development, it is possible. The most complex task is always inter process communication such as make virtual browser for Internet Explorer, Microsoft Edge of other similar browsers. In The world of Linux operating system, Orca screen reader is completely written in Python. There is no C or C++ libraryes to get information while using inter process communication. I Am meaning, that Orca source do not contain source files in such language. Sure, some Python bindings may contain some reference to native .so libraryes. Interprocess communication is not easy also because of memory leaks. Before NVDA developers have started to use C++ languages, they were used COm types and memory allocations have been dramatically increased. It would be A good experiment to try it with Autohotkey. Using object model of IE without external C or C++ DLL, only from plain Autohotkey. And observe, how many MB will autohotkey.exe allocate. Thank you for yours library again, very well done. I can not use accwiever, because I do not see at all, and when I Am using screen reader build in speaking mouse, and if I only simple move with mouse pointer till i AM listenning speech synthesizer feetback, and when I press CTRL+/ nothing happens. Sure, when I execute accwiever.ahk it display its fully accessible GUI, but all editable fields do not contain information at all.
Re: Acc library (MSAA) and AccViewer download links
Hi! First of all, thx for this class. Is amazing and it is helping me a lot.
I have a question that I think is simple:
There's a way to do something like this:
What I want is find the ID of the very last window opened, but I don't have any info about this window because this window will only exist after a click, so after the click that window will be the last one opened, and I want get the ID of it.
There's a way to do this?
I have a question that I think is simple:
There's a way to do something like this:
Code: Select all
functionX (){
ACC GIVE ME THE LAST WINDOW OPENED ID
}
There's a way to do this?
Re: Acc library (MSAA) and AccViewer download links
Is there any way to get the basic "AccViewer" example to work upon a mouse click (or possibly ignore the mouse click)? It seems that the code ONLY works if it executes while hovering, but by left clicking it changes what values you get in vOutput.
Re: Acc library (MSAA) and AccViewer download links
My apologies, the issue isn't left clicking messing up the vAcc___- values, the problem is some windows simply return wrong values. So for insqance, Windows Explorer doesn't seem to ever return the correct values for Min/Max/Close buttons if you trigger vOutput with LButton. However, the hover and trigger vOutput with q:: seems to ALWAYS work with these buttons.
So basically I'm really confused as to what is going on in trying to use this library with certain windows + Lbutton trigger. Task Manager is another incorrect one btw.
So basically I'm really confused as to what is going on in trying to use this library with certain windows + Lbutton trigger. Task Manager is another incorrect one btw.
Re: Acc library (MSAA) and AccViewer download links
Which version do you use? I recommend this one.
Re: Acc library (MSAA) and AccViewer download links
This version does in fact seem better, but there's a LOT in this script so I'm not sure how to extract the functions I need in order to write my own script that gathers all the Acc data into variables upon left clicking a button. Can you provide any help with this?
Also, I don't think Acc works well with Windows Apps? Is that correct? It seems like it can only find the titlebar, but can't find the min/max/close caption buttons. For instance, try it on Calc or Edge.
Re: Acc library (MSAA) and AccViewer download links
For Name: ControlId for EditControl in GUI is defined by vAccName in Gui, Add, Edit, x%_offset2% y180 w%_fullW% h20 vAccName.
Now when exploring window's elements (w/ mouse hovering) the function GetAccInfo() is being triggered periodically.
For Accessible info function Acc_ObjectFromPoint(ChildId) assigns Acc
Afterwards function UpdateAccInfo(Acc, ChildId, Obj_Path="") is called updating NameEdit Control via GuiControl, , AccName, % Stored.Name:= Acc.accName(ChildId).
Just follow the code flow!
Min, restore/max, close work fine:
Now when exploring window's elements (w/ mouse hovering) the function GetAccInfo() is being triggered periodically.
For Accessible info function Acc_ObjectFromPoint(ChildId) assigns Acc
Afterwards function UpdateAccInfo(Acc, ChildId, Obj_Path="") is called updating NameEdit Control via GuiControl, , AccName, % Stored.Name:= Acc.accName(ChildId).
Just follow the code flow!
Min, restore/max, close work fine:
Spoiler
Calculating is trickier because paths change when any operator is being applied and reset by C/Esc, but always correctly displayed by Viewer. So its not nice, but not entirely impossible.Return to “Scripts and Functions (v1)”
Who is online
Users browsing this forum: No registered users and 193 guests