Topics

Designing an Addoon for Web Browsing - i nee some help #addonrequest

Mohsen Mashhour
 

Hi
i am developing an add on for web browsing and i need to call some functions to jump to next page element like heading or link. without pressing a key on keyboard.
how could i do this?
best regards

Ibrahim Hamadeh
 

Hello
well you can try this:
import api
from browseMode import BrowseModeTreeInterceptor
obj = api.getNavigatorObject().treeInterceptor
if isinstance(obj, BrowseModeTreeInterceptor):
    BrowseModeTreeInterceptor.script_nextHeading(obj, gesture)
and if yo want to go to previous heading use
BrowseModeTreeInterceptor.script_previousHeading(obj, gesture)
and same thing with script_nextLink and script_previousLink
and other items also
attached with the message a file test1.py
script to go to next heading
in this file the script is executed inside a global plugin with the gesture: control+f2
enable scratchpad directory from advanced settings
open it, then put the file in the globalPlugins directory inside it
then restart NVDA,or reload plugins so that you can test it
hope that help.
ibrahim.   

On 6/29/2020 11:53 AM, Mohsen Mashhour wrote:
Hi
i am developing an add on for web browsing and i need to call some functions to jump to next page element like heading or link. without pressing a key on keyboard.
how could i do this?
best regards

Mohsen Mashhour
 

Thanks a lot
i give it a try.
but since i use no gesture at all in my add-on can i pass none as gesture i bellow line?
really appreciate your help.
BrowseModeTreeInterceptor.script_nextHeading(obj, gesture)

Mohsen Mashhour
 
Edited

Ok
i use the code it worked but only once. after it goes to the first heading it will not jump to another one either before or after.

Ibrahim Hamadeh
 

Hello
you can instead of gesture put None
the intended line will be like this
BrowseModeTreeInterceptor.script_nextHeading(obj, None)
now it will be independent of the gesture
you can put the script in a function
and call it when you want
well it is working for me well and did not stop
but try to get used to inspect the log viewer
when something does not work
change the debug mode to debug, thenopen the log viewer
uparrow to the place where the script got executed
then the log after it will help to figuure the problem
if you like copy the log related with the execution of the script
especially if there is an error, and paste it in the message
I hope that may help.
ibrahim.

On 7/1/2020 3:36 PM, Mohsen Mashhour wrote:

[Edited Message Follows]

Ok
i use the code it worked but only once. after it goes to the first heading it will not jump to another one either before or after.

Mohsen Mashhour
 

Hi
i put None and run it. (actually i wanted to delete the question regarding None but i cant :) )

after first use of script_nextHeading, NVDA moves to first Heading. and announce 
then when i try to use it a second time, in Log it says current object does not have a treeinterceptor property.

ibrahim i really like to have a chat with you regarding my addon maybe we could arrange it. i would really appreciate your help.

Ibrahim Hamadeh
 

Hello
well
if the current object does not have a treeinterceptor property
really I do not then have an idea what to do or how to solve this
I hope people on this list who may have any idea dealing with this situation would help
I hope they do.
regarding to get in touch,
inspite really the electricity these days is not helping at all,
I will send you a private message, so that when we have a chance to connect we do that.
greetings.
ibrahim.

On 7/1/2020 9:17 PM, Mohsen Mashhour wrote:
Hi
i put None and run it. (actually i wanted to delete the question regarding None but i cant :) )

after first use of script_nextHeading, NVDA moves to first Heading. and announce 
then when i try to use it a second time, in Log it says current object does not have a treeinterceptor property.

ibrahim i really like to have a chat with you regarding my addon maybe we could arrange it. i would really appreciate your help.

Mohsen Mashhour
 

On Wed, Jul 1, 2020 at 02:52 PM, Ibrahim Hamadeh wrote:
send you a private message, so that when we have a chance to connect we
Thx i will look forward to it