Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Accessibility Standard Library


  • Please log in to reply
39 replies to this topic
Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
I uploaded a preliminary/test version of Accessibility Standard Library.
It requires another standard library COM.ahk.

DOWNLOAD ACC.ahk AND COM.ahk.

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
Example: Screen Reader
Just click middle mouse button on the paragraph you want to read.

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


majkinetor
  • Moderators
  • 4512 posts
  • Last active: May 20 2019 07:41 AM
  • Joined: 24 May 2006
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.
Posted Image

Andreone
  • Members
  • 257 posts
  • Last active: Mar 19 2008 05:30 PM
  • Joined: 20 Jul 2007
This is excellent! :lol:

olfen
  • Members
  • 115 posts
  • Last active: Dec 25 2012 09:48 AM
  • Joined: 04 Jun 2005
Although not (yet) familiar with Active Accessibility, I'm grateful for you to share another great StdLib set of functions. Thanks.

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
Thanks, Guys!

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.

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

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.

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
The script was updated, a minor bug fix and improvement.

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007
Another Example:
Retrieve the infos about the active window and the child under the cursor.

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()


Mountie
  • Members
  • 20 posts
  • Last active: Nov 20 2009 09:08 PM
  • Joined: 30 Oct 2007
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.

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

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):
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


Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
In Word it copies the text "Microsoft Word Document" to the ClipBoard, in MultiEdit the filename being edited. Is this a Vista artifact?

Sean
  • Members
  • 2462 posts
  • Last active: Feb 07 2012 04:00 AM
  • Joined: 12 Feb 2007

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.

nonov
  • Guests
  • Last active:
  • Joined: --
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.

nonov
  • Guests
  • Last active:
  • Joined: --

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()