Sorry. I have no idea why all prefixes were missing there. I fixed that. And I'll post the example for your request in the thread of ShellFolder().Call to nonexistent function.
Accessibility Standard Library
/* api for acc.ahk ACC_Hex( num ) ACC_Value_( pacc, sValue [ , idChild ] ) ACC_Name_( pacc, sName [ , idChild ] ) ACC_DoDefaultAction( pacc [ , idChild ] ) ACC_HitTest( pacc [ , x, y ] ) ACC_Navigate( pacc [ , dir, idChild ] ) ACC_Location( pacc [ , idChild ] ) ACC_Select( pacc [ , nFlags, idChild ] ) ACC_DefaultAction( pacc [ , idChild ] ) ACC_Selection( pacc ) ACC_Focus( pacc ) ACC_KeyboardShortcut( pacc [ , idChild ] ) ACC_HelpTopic( pacc [ , idChild ] ) ACC_Help( pacc [ , idChild ] ) ACC_State( pacc [ , idChild ] ) ACC_Role( pacc [ , idChild ] ) ACC_Description( pacc [ , idChild ] ) ACC_Value( pacc [ , idChild ] ) ACC_Name( pacc [ , idChild ] ) ACC_Child( pacc, idChild ) ACC_ChildCount( pacc ) ACC_Parent( pacc ) ACC_Query( pacc ) ACC_WinEventProc( hHook, event, hWnd, idObject, idChild, eventThread, eventTime ) ACC_UnhookWinEvent( hHook ) ACC_SetWinEventHook( eventMin, eventMax, pCallback ) ACC_GetStateText( nState ) ACC_GetRoleText( nRole ) ACC_WindowFromAccessibleObject( pacc ) ACC_AccessibleObjectFromWindow( [ hWnd, idObject ] ) ACC_AccessibleObjectFromPoint( [ x, y ] ) ACC_AccessibleObjectFromEvent( hWnd, idObject, idChild ) ACC_AccessibleChildren( pacc, varChildren ) ACC_Term( ) ACC_Init( ) */
ʞɔпɟ əɥʇ ʇɐɥʍ
How did you parse it? I'm asking it as the function names are reversed.I made this for myself. Thought I would share. You can add to script if you want.
Anyway, I added it to ACC.zip as a separate file. The same with COM.zip and IE.zip.
Thanks for taking your time for these.
i guess i could have added a sort command to the script...or Reversed them...
ps: it does not matter what order they are in anyway for me, as I just add them to my AHK Autohotkey.api file that is used by SciTE.(so i get the calltips with parameters)
ʞɔпɟ əɥʇ ʇɐɥʍ
First: The scripts don't work without some sort of #include right? How do you guys skip this step? I use these include statements to avoid load errors:
#include e:\program files\AutoHotKey\Extras\Scripts\ACC.ahk
#include e:\program files\AutoHotKey\Extras\Scripts\COM.ahk
Once I get the script to load: I highlight some text and press my moulse MButton. But nothing happens. I can get a "MsgBox, got to here" message to load after the MButton press but no text to speech. On MS Vista do I need to install something? Shouldn't the test for "If Not psv:=COM_CreateObject("SAPI.SpVoice")" catch the error?
I'm probably asking a question I'm not smart enough to know better than to ask, but is it possible to loop through all of the Accessible child elements on a web page? I've been banging my head against a wall trying to find a way to work with some intranet pages at my place of work that have been "upgraded" with Flash content. Here's the info on the page element I'm trying to manipulate from your nifty "ACC Spy":
<Child under cursor> Name: Search: Value: Description: Role: editable text State: focusable (0x100000) Help: HelpTopic: Keyboard: DefAction: (l,t,w,h): 124,324,146,17
It's the only 'editable text' flash object on the page. If I can even give that field focus with ACC so I can send it text I'd be content and it appears acc_Focus could do that for me, but I can't seem to crack how I can loop through the objects to find the right one. Is it even possible?
As far as I can tell, there is no systematic way to obtain all accessible elements. You can use accNavigate for that purpose, but it's not guaranteed to retrieve all elements. BTW, why didn't use embeds function of DOM?but is it possible to loop through all of the Accessible child elements on a web page?
oWeb.document.embeds[n]
Also, have all components of ACC.ahk been wrapped into the COM Standard Library?
What's confusing with them?but the additional parameters of COM_AccessibleObjectFromWindow and COM_AccessibleChildren (for example) have gotten me a bit confused.
No, only ones that fit to COM.ahk.Also, have all components of ACC.ahk been wrapped into the COM Standard Library?
What's confusing with them?
Actually now that I look at it again, I was just confused in general. I was confusing COM_AccessibleChildren with being the equivalent of acc_Child, which doesn't appear to be implemented in the standard library, correct?
Right now I'm basically taking the easiest route to cannibalizing the concept behind the "ACC Spy" to develop some functionality for tank's announced web script recorder project. My main objective at this point is to obtain the state of the element under the mouse, with ACC that's pretty easy:
Acc_Init() pacc := Acc_AccessibleObjectFromPoint() pState:=(paccChild:=acc_Child(pacc, _idChild_)) ? acc_State(paccChild) : acc_State(pacc, _idChild_) MsgBox % pState Acc_Term()
Bear in mind that I've read nothing about the actual functionality of the ACC calls, just did a quick copy to obtain what I needed. :oops:
Would I be able to accomplish the same thing as the above with just COM?
Not all applications supporting Accessibility are compatible with COM.ahk, and there were slight changes on the parameters between ACC.ahk and COM.ahk, so if you're not prepared to handle those yourself you'd better stick with ACC.ahk. Anyway, I already posted a code in COM/COM_L/COM_U.Would I be able to accomplish the same thing as the above with just COM?
<!-- m -->http://www.autohotke...c22923-426.html<!-- m -->
And, here is an example of COM_AccessibleObjectFromPoint() in COM_L/COM_U.
CoordMode, Mouse MouseGetPos, x, y If oAcc := COM_AccessibleObjectFromPoint(x, y, idChild) MsgBox % nState := oAcc.accState(idChild)
Not all applications supporting Accessibility are compatible with COM.ahk, and there were slight changes on the parameters between ACC.ahk and COM.ahk, so if you're not prepared to handle those yourself you'd better stick with ACC.ahk.
I see. Does that explain, for example, why ACC_AccessibleObjectFromPoint supports optional x/y params and COM_AccessibleObjectFromPoint does not?
ACC_AccessibleObjectFromPoint(x = "", y = "", ByRef _idChild_ = "") { VarSetCapacity(varChild,16,0) x<>""&&y<>"" ? pt:=x&0xFFFFFFFF|y<<32 : DllCall("GetCursorPos", "int64P", pt) DllCall("oleacc\AccessibleObjectFromPoint", "int64", pt, "UintP", pacc, "Uint", &varChild) _idChild_ := NumGet(varChild, 8 ) Return pacc } COM_AccessibleObjectFromPoint(x, y, ByRef _idChild_="") { VarSetCapacity(varChild,16,0) If DllCall("oleacc\AccessibleObjectFromPoint", "int", x, "int", y, "UintP", pacc, "Uint", &varChild)=0 Return pacc, _idChild_:=NumGet(varChild, 8 ) }
By the way, I realize this is now becoming more about COM than the Accessibility functions themselves per se, would you rather me move this discussion to that thread?
And I don't understand the structure of the variant array varChildren
I use these include statements to avoid load errors:
#include e:\program files\AutoHotKey\Extras\Scripts\ACC.ahk
#include e:\program files\AutoHotKey\Extras\Scripts\COM.ahk
Just found this thread and am starting to play with this technique. Looks really promising! Is doing the include thing above the recommended way to link to the functions in those script files?
Thanks