[nvda-addons] Re: Executing NVDA commands programmatically

  • From: "Joseph Lee" <joseph.lee22590@xxxxxxxxx>
  • To: <nvda-addons@xxxxxxxxxxxxx>
  • Date: Fri, 10 Jul 2015 08:32:38 -0700

Hi,
For global commands, yes. You need to use:
globalCommands.GlobalCommands.script_name(gesture)
For apps, you need to test if the script can be found by using "has
attribute" function like so:
hasattr(object, "script")
Same goes with other attributes you wish to test. One useful way is to test
NVDA version indirectly by testing for presence of specific attributes in a
module.
Cheers,
Joseph


-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx] On Behalf Of Pranav Lal
Sent: Friday, July 10, 2015 6:51 AM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Executing NVDA commands programmatically

Hi all,

Is it possible to execute NVDA commands programmatically from within a NVDA
add-on? For example, if I wrote an add-on for Microsoft Word that did
something and I wanted it to read the current line, could I execute this
command from within the add-on? One way would be to execute the relevant key
combination but keys can be changed. Could I perhaps scroll through a
dictionary of gestures and or commands, find the one I want and then execute
it?

Pranav

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting
bugs.

Community addons are available from: http://addons.nvda-project.org To send
a message to the list: nvda-addons@xxxxxxxxxxxxx To change your list
settings/unsubscribe: //www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

----------------------------------------------------------------
NVDA add-ons: A list to discuss add-on code enhancements and for reporting
bugs.

Community addons are available from: http://addons.nvda-project.org
To send a message to the list: nvda-addons@xxxxxxxxxxxxx
To change your list settings/unsubscribe:
//www.freelists.org/list/nvda-addons
To contact list moderators: nvda-addons-moderators@xxxxxxxxxxxxx

Other related posts: