[nvda-addons] Re: Executing NVDA commands programmatically

  • From: "Pranav Lal" <pranav.lal@xxxxxxxxx>
  • To: <nvda-addons@xxxxxxxxxxxxx>
  • Date: Sun, 12 Jul 2015 09:37:35 +0530

Hi Joseph,

Many thanks. The line executes without an error but nothing happens. I am trying
it in the nvda python console. I have tried other scripts but the same thing
happens. See the following example.
globalCommands.commands.script_reportCurrentFocus(None)

Pranav
-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx [mailto:nvda-addons-bounce@xxxxxxxxxxxxx]
On Behalf Of Joseph Lee
Sent: Sunday, July 12, 2015 8:58 AM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Executing NVDA commands programmatically

Hi,
Ah yes, try:
globalCommands.commands.script_name
Cheers,
Joseph

-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx] On Behalf Of Pranav Lal
Sent: Saturday, July 11, 2015 8:18 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Executing NVDA commands programmatically

Hi Joseph,

I did try passing None without success or maybe I am calling the function
incorrectly.

globalCommands.GlobalCommands.script_dateTime(None)
Traceback (most recent call last):
File "<console>", line 1, in <module>
TypeError: unbound method script_dateTime() must be called with GlobalCommands
instance as first argument (got NoneType instance instead)

Pranav
-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx]
On Behalf Of Joseph Lee
Sent: Sunday, July 12, 2015 8:43 AM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Executing NVDA commands programmatically

Hi,
I would say None. Jamie is the professor of this kind of thing.
Cheers,
Joseph

-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx] On Behalf Of Pranav Lal
Sent: Saturday, July 11, 2015 7:53 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Executing NVDA commands programmatically

So Joseph, if I am executing the command programmatically, what can I pass in
the gesture object? Assume my command does nothing with the gesture. I have
tried to find this information in the documentation but have not had any success
so far. I'll be happy to write it up once I am clear about it.

-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx]
On Behalf Of Joseph Lee
Sent: Saturday, July 11, 2015 9:41 PM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Executing NVDA commands programmatically

Hi,
Gesture object contains things related to commands such as key presses, taps on
touchscreens and so on. You cannot simply pass None as gesture parameter, as
some scripts will look to see if the command was pressed multiple times, do
something with the gesture or pass it onto the program.
Cheers,
Joseph

-----Original Message-----
From: nvda-addons-bounce@xxxxxxxxxxxxx
[mailto:nvda-addons-bounce@xxxxxxxxxxxxx] On Behalf Of Alberto Buffolino
Sent: Saturday, July 11, 2015 2:10 AM
To: nvda-addons@xxxxxxxxxxxxx
Subject: [nvda-addons] Re: Executing NVDA commands programmatically

Joseph Lee (il 10/07/2015 17.32) ha scritto:
Hi, For global commands, yes. You need to use:
globalCommands.GlobalCommands.script_name(gesture)
Alberto:
Hi Joseph,
but, exactly, what is the gesture parameter? I mean, if script_name performs no
checks on passed gesture, I can do so:

def script_myscript(self, gesture):
blah blah
globalCommands.GlobalCommands.script_name(gesture)

But if it performs a check, how to I should build the gesture parameter?
Thanks.
Alberto
----------------------------------------------------------------
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

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

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

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