Code: Select all
oAcc := Acc_Get("Object", "1.30", 0, "ahk_id " hCtl)
Code: Select all
oAcc := Acc_Get("Object", "1.30", 0, "ahk_id " hCtl)
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(...)
;{
;...
;}
Code: Select all
Acc_Location(Acc, ChildId=0, byref Position="") { ; adapted from Sean's code
try Acc.accLocation(ComObj(0x4003,&x:=0), ComObj(0x4003,&y:=0), ComObj(0x4003,&w:=0), ComObj(0x4003,&h:=0), ChildId)
catch
return
Position := "x" NumGet(x,0,"int") " y" NumGet(y,0,"int") " w" NumGet(w,0,"int") " h" NumGet(h,0,"int")
return {x:NumGet(x,0,"int"), y:NumGet(y,0,"int"), w:NumGet(w,0,"int"), h:NumGet(h,0,"int")}
}
Code: Select all
;~Sean\Lib\Acc.ahk
Acc_Location(Acc, ChildId=0) { ; adapted from Sean's code
try Acc.accLocation(ComObj(0x4003,&x:=0), ComObj(0x4003,&y:=0), ComObj(0x4003,&w:=0), ComObj(0x4003,&h:=0), ChildId)
catch
return
return {x:NumGet(x,0,"int"), y:NumGet(y,0,"int"), w:NumGet(w,0,"int"), h:NumGet(h,0,"int")
, pos:"x" NumGet(x,0,"int")" y" NumGet(y,0,"int") " w" NumGet(w,0,"int") " h" NumGet(h,0,"int")}
}
;~jethrow\Acc.ahk
Acc_Location(Acc, ChildId=0) { ; adapted from Sean's code
try Acc.accLocation(ComObj(0x4003, & x := 0)
, ComObj(0x4003,&y:=0)
, ComObj(0x4003,&w:=0)
, ComObj(0x4003,&h:=0)
, ChildId)
catch
return
return { x:NumGet(x,0,"int")
, y:NumGet(y,0,"int")
, w:NumGet(w,0,"int")
, h:NumGet(h,0,"int")
, pos:"x" NumGet(x,0,"int")
. " y" NumGet(y,0,"int")
. " w" NumGet(w,0,"int")
. " h" NumGet(h,0,"int") }
}
Code: Select all
^t:: Msgbox % GetTextUnderMouse()
GetTextUnderMouse(){
Acc := Acc_ObjectFromPoint(child)
try value := Acc.accValue(child)
if Not value
try value := Acc.accName(child)
return value
}
return
Drag & drop AccViewers crosshair over the element for which you wanna see its details.dbareis wrote: ↑23 Mar 2022, 19:22I've used "Acc.ahk" to obtain the current URL from the active browser tab, now I'm trying to get the information required to get the path/directory/folder of the current "explorer.exe" tab.
I found "AccViewer.ahk" and it displays its dialog when run, as I move the mouse it doesn't do anything and if I lick the image on the top left it says "Acc_Children Failed" on line 508 (continue script?). I have tried again after restarting my Windows 10 computer. Are there instructions on how to use it somewhere or is it failing for some reason?
Thanks, I worked that out eventually, it shouldn't be that cryptic though.BoBo wrote: ↑11 May 2022, 16:27Drag & drop AccViewers crosshair over the element for which you wanna see its details.dbareis wrote: ↑23 Mar 2022, 19:22I've used "Acc.ahk" to obtain the current URL from the active browser tab, now I'm trying to get the information required to get the path/directory/folder of the current "explorer.exe" tab.
I found "AccViewer.ahk" and it displays its dialog when run, as I move the mouse it doesn't do anything and if I lick the image on the top left it says "Acc_Children Failed" on line 508 (continue script?). I have tried again after restarting my Windows 10 computer. Are there instructions on how to use it somewhere or is it failing for some reason?
Code: Select all
BL := "4,1,1,2,2,2,1,3,2,2,2,2,1,1"
xBirthDate := Acc_Get("Object", BL,, "ahk_exe chrome.exe").accValue(0)
MsgBox 0, % "BIRTHDATE 1 : " . BL, % xBirthDate
xBirthDate := Acc_Get("Object", BL,, "ahk_exe chrome.exe").accName(0)
MsgBox 0, % "BIRTHDATE 2 : " . BL, % xBirthDate
Yes, a quick fix for that is to replace the line
Thanks for that
Code: Select all
...
4.1.1.2.2.2 document [][]
4.1.1.2.3 pane [][]
4.1.1.2.4 pane [][]
4.1.1.2.4.1 pane [][]
4.1.1.2.4.2 separator [][]
4.1.1.2.4.2.1 slider [Side panel resize handle][]
...
I can use v1 acc.ahk and the Acc viewer in the latest version of Chrome without any issues.
Users browsing this forum: No registered users and 9 guests