 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Mon Jun 23, 2008 2:09 am Post subject: |
|
|
| nonov wrote: | | Call to nonexistent function. |
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(). |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1381 Location: USA
|
Posted: Fri Jul 11, 2008 4:23 am Post subject: |
|
|
I made this for myself. Thought I would share. You can add to script if you want.
| Code: | /* 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( )
*/
|
_________________
ʞɔпɟ əɥʇ ʇɐɥʍ |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Fri Jul 11, 2008 9:45 am Post subject: |
|
|
| ahklerner wrote: | | I made this for myself. Thought I would share. You can add to script if you want. |
How did you parse it? I'm asking it as the function names are reversed.
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. |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1381 Location: USA
|
Posted: Fri Jul 11, 2008 6:12 pm Post subject: |
|
|
lol in SciTE ^# is a hotkey to go to the previous paragraph...made a short little script that copies the selected text and saves it in a list...decided to use #a as my hotkey and the stupid cursor kept going back to the previous function so i used it to my advantage and just started from the bottom..
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) _________________
ʞɔпɟ əɥʇ ʇɐɥʍ |
|
| Back to top |
|
 |
RonFred Guest
|
Posted: Sat Dec 13, 2008 9:55 pm Post subject: I don't think this works on Vista? |
|
|
As a new guy to autohotkey I thought I would try the scripts on this thread.
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? |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Sat Nov 14, 2009 4:52 pm Post subject: |
|
|
Hey Sean,
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":
| Code: | <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? _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Sun Nov 15, 2009 12:18 am Post subject: |
|
|
| sinkfaze wrote: | | but is it possible to loop through all of the Accessible child elements on a web page? | 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?
| Code: | | oWeb.document.embeds[n] |
|
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Tue Nov 17, 2009 7:02 pm Post subject: |
|
|
One other question Sean, I was informed that ACC functionality has been wrapped into the COM Standard Library. I wanted to try converting your "ACC Spy" strictly to COM calls but the additional parameters of COM_AccessibleObjectFromWindow and COM_AccessibleChildren (for example) have gotten me a bit confused. Any hints you can give me on how to proceed?
Also, have all components of ACC.ahk been wrapped into the COM Standard Library? _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Wed Nov 18, 2009 12:38 am Post subject: |
|
|
| sinkfaze wrote: | | but the additional parameters of COM_AccessibleObjectFromWindow and COM_AccessibleChildren (for example) have gotten me a bit confused. | What's confusing with them?
| Quote: | | Also, have all components of ACC.ahk been wrapped into the COM Standard Library? | No, only ones that fit to COM.ahk. |
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Wed Nov 18, 2009 6:22 am Post subject: |
|
|
| Sean wrote: | | 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:
| Code: | 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.
Would I be able to accomplish the same thing as the above with just COM? _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Wed Nov 18, 2009 10:09 am Post subject: |
|
|
| sinkfaze wrote: | | 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.
http://www.autohotkey.com/forum/topic22923-426.html
And, here is an example of COM_AccessibleObjectFromPoint() in COM_L/COM_U.
| Code: | CoordMode, Mouse
MouseGetPos, x, y
If oAcc := COM_AccessibleObjectFromPoint(x, y, idChild)
MsgBox % nState := oAcc.accState(idChild)
|
|
|
| Back to top |
|
 |
sinkfaze
Joined: 18 Mar 2008 Posts: 5044 Location: the tunnel(?=light)
|
Posted: Wed Nov 18, 2009 3:38 pm Post subject: |
|
|
| Sean wrote: | | 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?
| Code: | 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? _________________ Try Quick Search for Autohotkey or see the tutorial for newbies. |
|
| Back to top |
|
 |
Guest
|
Posted: Sat Apr 17, 2010 8:44 am Post subject: |
|
|
| Can you create a small example, when accessibility library detects keyboard focus and speaks detected focus object name and type, example exit button? |
|
| Back to top |
|
 |
hughman
Joined: 11 Feb 2007 Posts: 166
|
Posted: Sat Jun 19, 2010 2:56 pm Post subject: |
|
|
I am very excited to get text from windows forms datagrid control via MSAA. But I want to know that if MSAA can maniplute the control without default actio, such as to select a row and double click it.
And I don't understand the structure of the variant array varChildren |
|
| Back to top |
|
 |
johnmsch
Joined: 15 Apr 2008 Posts: 14 Location: Marietta, GA
|
Posted: Tue Jul 27, 2010 9:44 pm Post subject: Re: I don't think this works on Vista? |
|
|
| RonFred wrote: |
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 |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|