Re: FW: [program-l] NVDA add-on development questions


James Scholes
 

As others have noted, lots of add-ons already do this e.g. Instant Translate. But overall, the best suggestion you can give this person is to join this list and then ask again.

Regards,

James Scholes

On 13/05/2020 at 2:43 pm, Joseph Lee wrote:
Hi,
Any ideas?
Cheers,
Joseph
*From:* program-l-bounce@... <program-l-bounce@...> *On Behalf Of *adil
*Sent:* Wednesday, May 13, 2020 12:21 PM
*To:* program-l@...
*Subject:* [program-l] NVDA add-on development questions
Hi all,
I’ve been trying to get my head around with nvda add-on development.
I have already read the nvda developer guide and add-on development guide. So far, I’m able to write simple add-on like saying messages, navigating object hierarchy etc.
I’m trying to get the selected text from the browser window.
I tried this code:
selObj = api.getFocusObject().selection
#copying the selected text to clipboard
selObj.copyToClipboard ()
the above code works in notepad, but it doesn’t work for browser.
What I know is so far it has to do something with the type of the object return by api.getFocusObjec t ().
For notepad, it returns
NVDAObjects.Dynamic_EnhancedEditFieldIAccessibleEditWindowNVDAObject object
And for browser window, it returns NVDAObjects.IAccessible.ia2Web.Ia2Web object.
Could someone explain me how do I get the selected text from the browser window?
How do you read the documentation for any class or object as there is no any in detail NVDA documentation?
I tried using pydoc utility to generate documentation from source code, but I just got loss.
Could you explain me how do I use pydoc to read documentation from NVDA source code?
Any tips/tricks are welcome!
Bunch of thanks in advance!
Sent from Mail <https%20:/go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
** To leave the list, click on the immediately-following link:- ** [mailto:program-l-request@...?subject=unsubscribe] ** If this link doesn't work then send a message to: ** program-l-request@... <mailto:program-l-request@...> ** and in the Subject line type ** unsubscribe ** For other list commands such as vacation mode, click on the ** immediately-following link:- ** [mailto:program-l-request@...?subject=faq] ** or send a message, to ** program-l-request@... <mailto:program-l-request@...> with the Subject:- faq

Join nvda-addons@nvda-addons.groups.io to automatically receive all group messages.