Hello,
I am trying to get info from Firefox window using ACC lib, so far i got the code working ok, but search is slow and going deep is time consuming but working.
My question is can i (or any one) make it more simplified/modified/ realistic as i made it very complicated and almost close chaos(using function call recursively).
i'm open to all suggestions, any help would be great
Thanks
Need Help in using ACC library Topic is solved
-
- Posts: 46
- Joined: 04 Dec 2017, 00:11
Re: Need Help in using ACC library Topic is solved
This may be relevant.
Acc: get text from all window/control elements - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40615
AccViewer might be useful, though you probably know about it already.
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
Some Acc examples with Firefox.
Firefox/Chrome, get tab names/focus tab - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26947
Acc: get text from all window/control elements - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40615
AccViewer might be useful, though you probably know about it already.
Acc library (MSAA) and AccViewer download links - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26201
Some Acc examples with Firefox.
Firefox/Chrome, get tab names/focus tab - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=26947
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
-
- Posts: 46
- Joined: 04 Dec 2017, 00:11
Re: Need Help in using ACC library
Hi Jeeswg,
I need to ask you a question though, i need Location of each in the loop, from here do i need to
1. Acc := Acc_ObjectFromPoint(ChildId)
Location := GetAccLocation(Acc, ChildId)
2. Acc := Acc_ObjectFromPath(Acc_ObjectFromWindow(Win), "4,25,1,1,1,8,2,1,1,1,2,2,1,1")
Location := Acc_Location(Acc)
after getting path
please clarify it, thanks.
Yes this is relevant, Thanks man, i previously found this script but never went into that deep,jeeswg wrote: ↑13 Dec 2018, 05:36This may be relevant.
Acc: get text from all window/control elements - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40615
I need to ask you a question though, i need Location of each in the loop, from here do i need to
1. Acc := Acc_ObjectFromPoint(ChildId)
Location := GetAccLocation(Acc, ChildId)
2. Acc := Acc_ObjectFromPath(Acc_ObjectFromWindow(Win), "4,25,1,1,1,8,2,1,1,1,2,2,1,1")
Location := Acc_Location(Acc)
after getting path
please clarify it, thanks.
Re: Need Help in using ACC library
I also have trouble with hierarchy higher than 2. Example: path 5.2 is ok but 4.5.2 is not
The only way I found to make this work is to isolate the classNN of the closest parent to the control I am looking for.
But I have never been able to get text from a control that is somehwere in a complex hierarchy. Acc Viewer only reveals 2 steps of path its wierd
Your last example with the path: 4,25,1,1,1,8,2,1,1,1,2,2,1,1 would be a complete failure for me unless I learn how to correctly find the right path sequence too
But what is cool is that when it works, it works so worth the effort.
Btw the isolate classNN tip which is the only way I got it working was feom you Jee so again and again, thank you
Edit: forgot to mention that I am using traditionnal acc librairy function acc_get("object....)
The only way I found to make this work is to isolate the classNN of the closest parent to the control I am looking for.
But I have never been able to get text from a control that is somehwere in a complex hierarchy. Acc Viewer only reveals 2 steps of path its wierd
Your last example with the path: 4,25,1,1,1,8,2,1,1,1,2,2,1,1 would be a complete failure for me unless I learn how to correctly find the right path sequence too
But what is cool is that when it works, it works so worth the effort.
Btw the isolate classNN tip which is the only way I got it working was feom you Jee so again and again, thank you
Edit: forgot to mention that I am using traditionnal acc librairy function acc_get("object....)
Re: Need Help in using ACC library
Here's some code for getting the coordinates of an element.
Code: Select all
q:: ;Acc - get position of element under cursor
oAcc := Acc_ObjectFromPoint(vChildID)
Acc_Location(oAcc, vChildID, vPos)
MsgBox, % vPos
return
w:: ;Notepad - get Edit control position
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "4.1.4", 0, "ahk_id " hWnd)
Acc_Location(oAcc, 0, vPos)
MsgBox, % vPos
return
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: Need Help in using ACC library
Thank you. So this should find the complete hierarchy / path ?
I will try it tommorow
I will try it tommorow
-
- Posts: 46
- Joined: 04 Dec 2017, 00:11
Re: Need Help in using ACC library
I did not test it yet im sorry
-
- Posts: 46
- Joined: 04 Dec 2017, 00:11
Re: Need Help in using ACC library
Hi DRocks,
Good news for both of us i got it working finally
""Acc: get text from all window/control elements - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40615 ""
turns out "jeeswg's" script is giving perfect path than "Accessible info Viewer" in this case.
hope it helps any one else who needs it.
have a great day
Good news for both of us i got it working finally
""Acc: get text from all window/control elements - AutoHotkey Community
https://autohotkey.com/boards/viewtopic.php?f=6&t=40615 ""
turns out "jeeswg's" script is giving perfect path than "Accessible info Viewer" in this case.
hope it helps any one else who needs it.
have a great day
Re: Need Help in using ACC library
Hello rakesha002, in the last few days I wrote this post comparing my top-down 'AccGetTextAll' function against the (in some ways unreliable) bottom-up AccViewer approach.
How to get the full ACC path for control on cursor? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 29#p253329
How to get the full ACC path for control on cursor? - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 29#p253329
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
-
- Posts: 46
- Joined: 04 Dec 2017, 00:11
Re: Need Help in using ACC library
Hi, jeeswg,
Thank you for your great scripts, those works like a charm in my daily routine, keep up the good work
have a great day
Thank you for your great scripts, those works like a charm in my daily routine, keep up the good work
have a great day
-
- Posts: 46
- Joined: 04 Dec 2017, 00:11
Re: Need Help in using ACC library
Hi, jeeswg,
Can i ask one more question, i'm curious though
like location and other parameters can i get path under mouse cursor (object from point of-course)
Thanks
Can i ask one more question, i'm curious though
like location and other parameters can i get path under mouse cursor (object from point of-course)
Thanks
Re: Need Help in using ACC library
- That's the question I address in the link above. It's difficult to always get the numbers right (nth child), and to know how many numbers to use (at what point stop as you add numbers to the left).
- I may return to the function to use more criteria to try and get the numbers right, and to indicate whenever a number is uncertain.
- Issues to do with how many numbers to use have been a bit baffling. However, I might consider combining a top-down (like my get all text function) and a bottom-up approach. This could be somewhat slow though.
- For my own use however, I've been happy just to use the top-down approach that lists every GUI element, and haven't really needed an element under cursor approach. It's only been because AccViewer attempts this and because people have asked for it, that I've investigated it. (Well, it was a worthwhile question to investigate anyhow.)
- I may return to the function to use more criteria to try and get the numbers right, and to indicate whenever a number is uncertain.
- Issues to do with how many numbers to use have been a bit baffling. However, I might consider combining a top-down (like my get all text function) and a bottom-up approach. This could be somewhat slow though.
- For my own use however, I've been happy just to use the top-down approach that lists every GUI element, and haven't really needed an element under cursor approach. It's only been because AccViewer attempts this and because people have asked for it, that I've investigated it. (Well, it was a worthwhile question to investigate anyhow.)
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
-
- Posts: 46
- Joined: 04 Dec 2017, 00:11
Re: Need Help in using ACC library
Hi, jeeswg,
Yep, your are right about every thing you said, and somewhat i know the answer as well,
Currently I'm looking into your new "bottom-up approach" since you've mentioned it here, "For me it is complete failure on Firefox so far gives only controls vIndex"
Edit :
I need to ask you a favor(or any one else who's interested),
I found a work around to find path of control under mouse in firefox from your script,
Can you make it any faster, for me it is almost 10 sec, and
finding is in active tab only so every thing else not required, take off extra load or something you know better than me.
Thanks.
Yep, your are right about every thing you said, and somewhat i know the answer as well,
Currently I'm looking into your new "bottom-up approach" since you've mentioned it here, "For me it is complete failure on Firefox so far gives only controls vIndex"
Edit :
I need to ask you a favor(or any one else who's interested),
I found a work around to find path of control under mouse in firefox from your script,
Can you make it any faster, for me it is almost 10 sec, and
finding is in active tab only so every thing else not required, take off extra load or something you know better than me.
Thanks.
- Attachments
-
- Get_AccPath.ahk
- Finding control's path (firefox mainly)
- (2.41 KiB) Downloaded 131 times
Who is online
Users browsing this forum: Shifted_Right and 203 guests