active accessibility click selectable

Get help with using AutoHotkey and its commands and hotkeys
hrvoje83
Posts: 45
Joined: 01 Mar 2017, 10:37

active accessibility click selectable

04 Oct 2017, 06:07

Hello,

Can anyone help me how to click this selectable "test" file?
Attachments
Capture.PNG
Capture.PNG (23.71 KiB) Viewed 651 times
User avatar
jeeswg
Posts: 5942
Joined: 19 Dec 2016, 01:58
Location: UK

Re: active accessibility click selectable

04 Oct 2017, 08:21

One of these two may work:

Code: Select all

q::
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "5.1.1.1.1.1.4.1", 0, "ahk_id " hWnd)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

w::
ControlGet, hCtl, Hwnd,, NETUIHWND4, A
oAcc := Acc_Get("Object", "5.1.1.1.1.1.4.1", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(0)
oAcc := ""
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
hrvoje83
Posts: 45
Joined: 01 Mar 2017, 10:37

Re: active accessibility click selectable

04 Oct 2017, 08:54

Hmm, still nothing.
I am trying your combination and even this two bellow, still nothing.

This selectable folder is part of MS outlook, but I want to know this function also for other programs, because of that I am asking for a solution.

Also there was one try with oAcc.accDoDefaultState(0), but also nothing.

Code: Select all

WinActivate, ahk_class rctrl_renwnd32
#Include C:\Users\UI287714\Desktop\Active accesibility staviti lib u AH folder\Lib\Acc.ahk
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "5.1.1.1.1.1.4.1", 0, "ahk_id " hWnd)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

WinActivate, ahk_class rctrl_renwnd32
ControlGet, hCtl, Hwnd,, NETUIHWND4, A
#Include C:\Users\UI287714\Desktop\Active accesibility staviti lib u AH folder\Lib\Acc.ahk
oAcc := Acc_Get("Object", "5.1.1.1.1.1.4.1", 0, "ahk_id " hCtl)
oAcc.accDoDefaultAction(0)
oAcc := ""
return
User avatar
jeeswg
Posts: 5942
Joined: 19 Dec 2016, 01:58
Location: UK

Re: active accessibility click selectable

04 Oct 2017, 09:02

You could try "4.1.5.1.1.1.1.1.4.1", i.e. put '4.1.' at the front of the path. Hmm, there is no stated action for the element, that field is empty.

Or use the coordinates with Click/MouseClick/Send (with Click)/SendInput (with Click)/ControlClick.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
hrvoje83
Posts: 45
Joined: 01 Mar 2017, 10:37

Re: active accessibility click selectable

06 Oct 2017, 05:26

Hi jeeswg,

Thank you but still nothing.

Is there any other way except click by coordinates to click on Outlook folder?
User avatar
jeeswg
Posts: 5942
Joined: 19 Dec 2016, 01:58
Location: UK

Re: active accessibility click selectable

06 Oct 2017, 16:58

I did some experiments with Explorer, and was to able to invoke opening a file. So perhaps some of the code below could be useful.

Something like MsgBox, % oAcc.accName(0) might be useful, to check that you have the right object.

Outlook uses COM, so perhaps that could be useful.

Sometimes you can paste a path into an Edit control and send Enter, or add a folder as a toolbar button (and you can invoke the toolbar button via Acc). Possibly you could create a shortcut that starts with an unusual character and send that character followed by Enter.

Code: Select all

q:: ;Explorer window - invoke first file (Windows 7, large icons)
WinGet, hWnd, ID, A
oAcc := Acc_Get("Object", "4.3.4.1.4.1.4.4.4.1.4.2", 0, "ahk_id " hWnd)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

w:: ;Explorer window - invoke first file (Windows 7, large icons)
ControlGet, hCtl, Hwnd,, DirectUIHWND3, A
oAcc := Acc_Get("Object", "4.2", 0, "ahk_id " hCtl)
MsgBox, % oAcc.accName(0) "`r`n" oAcc.accValue(0)
oAcc.accDoDefaultAction(0)
oAcc := ""
return

e:: ;Explorer window - invoke first file (Windows 7, large icons)
ControlGet, hCtl, Hwnd,, DirectUIHWND3, A
oAcc := Acc_Get("Object", "4.2", 0, "ahk_id " hCtl)
oRect := Acc_Location(oAcc)
WinGetPos, vWinX, vWinY, vWinW, vWinH, A
vPosX := Round(oRect.x + oRect.w/2) - vWinX
vPosY := Round(oRect.y + oRect.h/2) - vWinY
MouseMove, % vPosX, % vPosY
ControlClick, % Format("X{} Y{}", vPosX, vPosY), A,,, 2
oAcc := ""
return
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], electrone77, scriptor2016, sinkfaze, SOTE and 183 guests