AutoHotkey Community

It is currently May 25th, 2012, 8:51 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: October 4th, 2007, 4:16 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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 June 23rd, 2008, 2:53 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2007, 4:19 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2007, 4:31 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2007, 6:52 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
This is excellent! :lol:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2007, 7:01 pm 
Offline

Joined: June 4th, 2005, 1:30 am
Posts: 113
Location: Stuttgart, Germany
Although not (yet) familiar with Active Accessibility, I'm grateful for you to share another great StdLib set of functions. Thanks.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 4th, 2007, 11:41 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 5th, 2007, 4:40 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2007, 7:31 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
The script was updated, a minor bug fix and improvement.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 7th, 2007, 7:34 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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 June 23rd, 2008, 3:00 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 9th, 2007, 4:26 am 
Offline

Joined: October 30th, 2007, 1:40 pm
Posts: 20
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 9th, 2007, 6:34 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 9th, 2007, 7:07 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
In Word it copies the text "Microsoft Word Document" to the ClipBoard, in MultiEdit the filename being edited. Is this a Vista artifact?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 9th, 2007, 9:32 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 23rd, 2008, 2:21 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 23rd, 2008, 2:28 am 
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()


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
Powered by phpBB® Forum Software © phpBB Group