AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Accessibility Standard Library
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Thu Oct 04, 2007 4:16 pm    Post subject: Accessibility Standard Library Reply with quote

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
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Thu Oct 04, 2007 4:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
majkinetor



Joined: 24 May 2006
Posts: 3615
Location: Belgrade

PostPosted: Thu Oct 04, 2007 4:31 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Thu Oct 04, 2007 6:52 pm    Post subject: Reply with quote

This is excellent! Laughing
Back to top
View user's profile Send private message
olfen



Joined: 04 Jun 2005
Posts: 99
Location: Stuttgart, Germany

PostPosted: Thu Oct 04, 2007 7:01 pm    Post subject: Reply with quote

Although not (yet) familiar with Active Accessibility, I'm grateful for you to share another great StdLib set of functions. Thanks.
Back to top
View user's profile Send private message Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Thu Oct 04, 2007 11:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Fri Oct 05, 2007 4:40 am    Post subject: Reply with quote

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
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Sun Oct 07, 2007 7:31 am    Post subject: Reply with quote

The script was updated, a minor bug fix and improvement.
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Sun Oct 07, 2007 7:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Mountie



Joined: 30 Oct 2007
Posts: 13

PostPosted: Fri Nov 09, 2007 4:26 am    Post subject: Reply with quote

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
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Fri Nov 09, 2007 6:34 am    Post subject: Reply with quote

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
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3959
Location: Pittsburgh

PostPosted: Fri Nov 09, 2007 7:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 1281

PostPosted: Fri Nov 09, 2007 9:32 am    Post subject: Reply with quote

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
View user's profile Send private message
nonov
Guest





PostPosted: Mon Jun 23, 2008 2:21 am    Post subject: Reply with quote

hello you brought me from COM Thread Smile
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





PostPosted: Mon Jun 23, 2008 2:28 am    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group