| View previous topic :: View next topic |
| Author |
Message |
Sean
Joined: 12 Feb 2007 Posts: 1281
|
Posted: Thu Oct 04, 2007 4:16 pm Post subject: Accessibility Standard Library |
|
|
I uploaded a preliminary/test version of Accessibility Standard Library.
It requires another standard library COM.ahk.
DOWNLOAD ACC.ahk AND COM.ahk.
Last edited by Sean on Mon Jun 23, 2008 2:53 am; edited 1 time in total |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1281
|
Posted: Thu Oct 04, 2007 4:19 pm Post subject: |
|
|
Example: Screen Reader
Just click middle mouse button on the paragraph you want to read.
| Code: | OnExit, AccClose
ACC_Init()
If Not psv:=COM_CreateObject("SAPI.SpVoice")
ExitApp
~MButton::
If Not pacc := ACC_AccessibleObjectFromPoint()
Return
If paccChild:=acc_Child(pacc, _idChild_)
sResult := acc_Name(paccChild), COM_Release(paccChild)
Else sResult := acc_Name(pacc, _idChild_)
COM_Release(pacc)
COM_Invoke(psv, "Speak", sResult)
Return
AccClose:
COM_Release(psv)
ACC_Term()
ExitApp
|
|
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3615 Location: Belgrade
|
Posted: Thu Oct 04, 2007 4:31 pm Post subject: |
|
|
Thats awesome, exactly what I wanted to do.
Can you manage to get only the clicked word, contrary to reading entire string ?
For instance, I clicked Internet Explorer button in the taskbar, on the word Internet. I want to have option for it to read me just Internet, not "Internet Explorer"
Thx, great work. _________________
 |
|
| Back to top |
|
 |
Andreone
Joined: 20 Jul 2007 Posts: 257 Location: Paris, France
|
Posted: Thu Oct 04, 2007 6:52 pm Post subject: |
|
|
This is excellent!  |
|
| Back to top |
|
 |
olfen
Joined: 04 Jun 2005 Posts: 99 Location: Stuttgart, Germany
|
Posted: Thu Oct 04, 2007 7:01 pm Post subject: |
|
|
| Although not (yet) familiar with Active Accessibility, I'm grateful for you to share another great StdLib set of functions. Thanks. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1281
|
Posted: Thu Oct 04, 2007 11:41 pm Post subject: |
|
|
Thanks, Guys!
| majkinetor wrote: | | Can you manage to get only the clicked word, contrary to reading entire string ? |
I thought it should be easy as it may be a matter of adding/defining a new delimiter, however, there seems to be no obvious way to do it. I may take a look further. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1281
|
Posted: Fri Oct 05, 2007 4:40 am Post subject: |
|
|
| Quote: | | I thought it should be easy as it may be a matter of adding/defining a new delimiter, however, there seems to be no obvious way to do it. I may take a look further. |
On second thought, I'm afraid that Accessibility may not want to support to this granularity as it would mean to create/support tremendous objects at once. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1281
|
Posted: Sun Oct 07, 2007 7:31 am Post subject: |
|
|
| The script was updated, a minor bug fix and improvement. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1281
|
Posted: Sun Oct 07, 2007 7:34 am Post subject: |
|
|
Another Example:
Retrieve the infos about the active window and the child under the cursor.
| Code: | ACC_Init()
pacc := Acc_AccessibleObjectFromWindow()
sResult .= "<Active Window>`n"
. "Name:`t`t" . acc_Name(pacc) . "`n"
. "Value:`t`t" . acc_Value(pacc) . "`n"
. "Description:`t" . acc_Description(pacc) . "`n"
. "Role:`t`t" . acc_Role(pacc) . "`n"
. "State:`t`t" . acc_State(pacc) . "`n"
. "Help:`t`t" . acc_Help(pacc) . "`n"
. "HelpTopic:`t" . acc_HelpTopic(pacc) . "`n"
. "Keyboard:`t" . acc_KeyboardShortcut(pacc) . "`n"
. "DefAction:`t" . acc_DefaultAction(pacc) . "`n"
. "(l,t,w,h):`t`t" . acc_Location(pacc) . "`n"
COM_Release(pacc)
MsgBox, % sResult
pacc := Acc_AccessibleObjectFromPoint()
If paccChild:=acc_Child(pacc, _idChild_)
sResult .= "`n`n<Child under cursor>`n"
. "Name:`t`t" . acc_Name(paccChild) . "`n"
. "Value:`t`t" . acc_Value(paccChild) . "`n"
. "Description:`t" . acc_Description(paccChild) . "`n"
. "Role:`t`t" . acc_Role(paccChild) . "`n"
. "State:`t`t" . acc_State(paccChild) . "`n"
. "Help:`t`t" . acc_Help(paccChild) . "`n"
. "HelpTopic:`t" . acc_HelpTopic(paccChild) . "`n"
. "Keyboard:`t" . acc_KeyboardShortcut(paccChild) . "`n"
. "DefAction:`t" . acc_DefaultAction(paccChild) . "`n"
. "(l,t,w,h):`t`t" . acc_Location(paccChild) . "`n"
, COM_Release(paccChild)
Else sResult .= "`n`n<Child under cursor>`n"
. "Name:`t`t" . acc_Name(pacc, _idChild_) . "`n"
. "Value:`t`t" . acc_Value(pacc, _idChild_) . "`n"
. "Description:`t" . acc_Description(pacc, _idChild_) . "`n"
. "Role:`t`t" . acc_Role(pacc, _idChild_) . "`n"
. "State:`t`t" . acc_State(pacc, _idChild_) . "`n"
. "Help:`t`t" . acc_Help(pacc, _idChild_) . "`n"
. "HelpTopic:`t" . acc_HelpTopic(pacc, _idChild_) . "`n"
. "Keyboard:`t" . acc_KeyboardShortcut(pacc, _idChild_) . "`n"
. "DefAction:`t" . acc_DefaultAction(pacc, _idChild_) . "`n"
. "(l,t,w,h):`t`t" . acc_Location(pacc, _idChild_) . "`n"
COM_Release(pacc)
MsgBox, % sResult
ACC_Term()
|
Last edited by Sean on Mon Jun 23, 2008 3:00 am; edited 1 time in total |
|
| Back to top |
|
 |
Mountie
Joined: 30 Oct 2007 Posts: 13
|
Posted: Fri Nov 09, 2007 4:26 am Post subject: |
|
|
I've downloaded the COM & ACC scripts to the standard library, but am a
little lost on what to do next in order to be able to activate the
functionality that will allow the copying of a word underneath the cursor in
the current window to the clipboard?
Thank you. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1281
|
Posted: Fri Nov 09, 2007 6:34 am Post subject: |
|
|
| Mountie wrote: | I've downloaded the COM & ACC scripts to the standard library, but am a
little lost on what to do next in order to be able to activate the
functionality that will allow the copying of a word underneath the cursor in
the current window to the clipboard? |
This may be what you're looking for (MButton as the hotkey):
| Code: | OnExit, AccClose
ACC_Init()
Return
AccClose:
ACC_Term()
ExitApp
~MButton::
If Not pacc := ACC_AccessibleObjectFromPoint()
Return
If paccChild:= acc_Child(pacc, _idChild_)
sResult := acc_Name(paccChild), COM_Release(paccChild)
Else sResult := acc_Name(pacc, _idChild_)
COM_Release(pacc)
Clipboard := sResult
Return
|
|
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 3959 Location: Pittsburgh
|
Posted: Fri Nov 09, 2007 7:07 am Post subject: |
|
|
| In Word it copies the text "Microsoft Word Document" to the ClipBoard, in MultiEdit the filename being edited. Is this a Vista artifact? |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 1281
|
Posted: Fri Nov 09, 2007 9:32 am Post subject: |
|
|
| Laszlo wrote: | | In Word it copies the text "Microsoft Word Document" to the ClipBoard, in MultiEdit the filename being edited. Is this a Vista artifact? |
The Word Document (Child Window) does not support the Accessibility, while do other parts like menubar, toolbar, etc. However, I think you can access the contents of the documents via Word.Document COM object.
BTW, I don't know of MultiEdit. |
|
| Back to top |
|
 |
nonov Guest
|
Posted: Mon Jun 23, 2008 2:21 am Post subject: |
|
|
hello you brought me from COM Thread
i'm reading Introduction to Microsoft Active Accessibility right now but seems it's not that easy. although SAPI example is amazing. could you please demonstrate any other very basic example? i don't know that where i can apply this amazing library yet.. anyway Thank you for notice this. |
|
| Back to top |
|
 |
nonov Guest
|
Posted: Mon Jun 23, 2008 2:28 am Post subject: |
|
|
| Quote: | Another Example:
Retrieve the infos about the active window and the child under the cursor. | This example doesn't working with following error message
Call to nonexistent function.
Specifically: AccessibleObjectFromWindow() |
|
| Back to top |
|
 |
|