GET link from riche edit


Stefan Moisei
 

hello,
riche edit text fields seem to contain links that are recognised by NVDA, since I hear link and out of link when traversing them. How to programatically get the link, though? object dev info doesn't show anything useful. can I do it via text info, or is there some custom API for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states: State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable: True', 'hasFocus: False', 'Python object: <NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav object at 0x0D3566D0>', "Python class mro: (<class 'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>, <class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>, <class 'globalPlugins.ndtt.logReader.LogContainer'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.edit.RichEdit50'>, <class 'NVDAObjects.window.edit.RichEdit'>, <class 'NVDAObjects.window.edit.Edit'>, <class 'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class 'NVDAObjects.behaviors.EditableText'>, <class 'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>, <class 'globalPlugins.indent_nav.EditableIndentNav'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", 'description: None', 'location: RectLTWH(left=2, top=117, width=1916, height=839)', "value: '


Brian's Mail list account
 

Was this in Wordpad? If not and in word some seem to work in focus mode for me,but not seemingly all the time.
Brian

--
bglists@...
Sent via blueyonder.(Virgin media)
Please address personal E-mail to:-
briang1@..., putting 'Brian Gaff'
in the display name field.

----- Original Message -----
From: "Stefan Moisei via groups.io" <vor_tex123@...>
To: <nvda-addons@nvda-addons.groups.io>
Sent: Thursday, September 15, 2022 3:01 PM
Subject: [nvda-addons] GET link from riche edit


hello,
riche edit text fields seem to contain links that are recognised by
NVDA, since I hear link and out of link when traversing them. How to
programatically get the link, though? object dev info doesn't show
anything useful. can I do it via text info, or is there some custom API
for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better
understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states:
State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable: True',
'hasFocus: False', 'Python object:
<NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav
object at 0x0D3566D0>', "Python class mro: (<class
'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>,
<class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>, <class
'globalPlugins.ndtt.logReader.LogContainer'>, <class
'NVDAObjects.IAccessible.IAccessible'>, <class
'NVDAObjects.window.edit.RichEdit50'>, <class
'NVDAObjects.window.edit.RichEdit'>, <class
'NVDAObjects.window.edit.Edit'>, <class
'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class
'NVDAObjects.behaviors.EditableText'>, <class
'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>,
<class 'globalPlugins.indent_nav.EditableIndentNav'>, <class
'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>,
<class 'baseObject.ScriptableObject'>, <class
'baseObject.AutoPropertyObject'>, <class
'garbageHandler.TrackedObject'>, <class 'object'>)", 'description:
None', 'location: RectLTWH(left=2, top=117, width=1916, height=839)',
"value: '


Noelia Ruiz
 

Hi:

The only way that I can think now is to find strings of text that
maybe reported as links in certain controls. But I believe that more
robust solutions can be provided.
For reference, in case code is useful to find out this, another
example maybe found in this pull request:
https://github.com/nvaccess/nvda/pull/13985


2022-09-15 16:01 GMT+02:00, Stefan Moisei via groups.io
<vor_tex123@...>:

hello,
riche edit text fields seem to contain links that are recognised by
NVDA, since I hear link and out of link when traversing them. How to
programatically get the link, though? object dev info doesn't show
anything useful. can I do it via text info, or is there some custom API
for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better
understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states:
State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable: True',
'hasFocus: False', 'Python object:
<NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav

object at 0x0D3566D0>', "Python class mro: (<class
'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>,

<class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>, <class
'globalPlugins.ndtt.logReader.LogContainer'>, <class
'NVDAObjects.IAccessible.IAccessible'>, <class
'NVDAObjects.window.edit.RichEdit50'>, <class
'NVDAObjects.window.edit.RichEdit'>, <class
'NVDAObjects.window.edit.Edit'>, <class
'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class
'NVDAObjects.behaviors.EditableText'>, <class
'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>,
<class 'globalPlugins.indent_nav.EditableIndentNav'>, <class
'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>,
<class 'baseObject.ScriptableObject'>, <class
'baseObject.AutoPropertyObject'>, <class
'garbageHandler.TrackedObject'>, <class 'object'>)", 'description:
None', 'location: RectLTWH(left=2, top=117, width=1916, height=839)',
"value: '






Stefan Moisei
 

Seems ok for my case. I am trying to ghet the focused link from a richedit, since it is an audio file and I want to play it with a keyboard shortcut, without opening it.
In your example, I found in views.py a method to add a link to the end of a text box... is this what you meant, or is there a method to extract links, too?
Thanks.

------ Original Message ------
From: "Noelia Ruiz" <nrm1977@...>
To: nvda-addons@nvda-addons.groups.io
Sent: 16.09.2022 06:58:32
Subject: Re: [nvda-addons] GET link from riche edit

Hi:

The only way that I can think now is to find strings of text that
maybe reported as links in certain controls. But I believe that more
robust solutions can be provided.
For reference, in case code is useful to find out this, another
example maybe found in this pull request:
https://github.com/nvaccess/nvda/pull/13985


2022-09-15 16:01 GMT+02:00, Stefan Moisei via groups.io
<vor_tex123@...>:
hello,
riche edit text fields seem to contain links that are recognised by
NVDA, since I hear link and out of link when traversing them. How to
programatically get the link, though? object dev info doesn't show
anything useful. can I do it via text info, or is there some custom API
for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better
understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states:
State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable: True',
'hasFocus: False', 'Python object:
<NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav

object at 0x0D3566D0>', "Python class mro: (<class
'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>,

<class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>, <class
'globalPlugins.ndtt.logReader.LogContainer'>, <class
'NVDAObjects.IAccessible.IAccessible'>, <class
'NVDAObjects.window.edit.RichEdit50'>, <class
'NVDAObjects.window.edit.RichEdit'>, <class
'NVDAObjects.window.edit.Edit'>, <class
'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class
'NVDAObjects.behaviors.EditableText'>, <class
'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>,
<class 'globalPlugins.indent_nav.EditableIndentNav'>, <class
'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>,
<class 'baseObject.ScriptableObject'>, <class
'baseObject.AutoPropertyObject'>, <class
'garbageHandler.TrackedObject'>, <class 'object'>)", 'description:
None', 'location: RectLTWH(left=2, top=117, width=1916, height=839)',
"value: '









Noelia Ruiz
 

I was trying to suggest you to see the code, without thinking about
something precise.
I've been playing with wx.TE_AUTO_URL style in the readonly multiline
edit box of views.py in addonStoreGui, but this seems not to be useful
to create links.
In readFeeds add-on, I use just an HTML file with JavaScript to show
links and other controls. In this way we can use browse mode to read,
andwrite HTML with known and documented procedures, in case this helps
you if you prefer not to use wx edit boxes.
https://github.com/nvdaes/readFeeds
Cheers

2022-09-19 13:21 GMT+02:00, Stefan Moisei via groups.io
<vor_tex123@...>:

Seems ok for my case. I am trying to ghet the focused link from a
richedit, since it is an audio file and I want to play it with a
keyboard shortcut, without opening it.
In your example, I found in views.py a method to add a link to the end
of a text box... is this what you meant, or is there a method to
extract links, too?
Thanks.
------ Original Message ------
From: "Noelia Ruiz" <nrm1977@...>
To: nvda-addons@nvda-addons.groups.io
Sent: 16.09.2022 06:58:32
Subject: Re: [nvda-addons] GET link from riche edit

Hi:

The only way that I can think now is to find strings of text that
maybe reported as links in certain controls. But I believe that more
robust solutions can be provided.
For reference, in case code is useful to find out this, another
example maybe found in this pull request:
https://github.com/nvaccess/nvda/pull/13985


2022-09-15 16:01 GMT+02:00, Stefan Moisei via groups.io
<vor_tex123@...>:
hello,
riche edit text fields seem to contain links that are recognised by
NVDA, since I hear link and out of link when traversing them. How to
programatically get the link, though? object dev info doesn't show
anything useful. can I do it via text info, or is there some custom API
for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better
understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states:
State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable: True',
'hasFocus: False', 'Python object:

<NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav

object at 0x0D3566D0>', "Python class mro: (<class

'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>,

<class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>, <class
'globalPlugins.ndtt.logReader.LogContainer'>, <class
'NVDAObjects.IAccessible.IAccessible'>, <class
'NVDAObjects.window.edit.RichEdit50'>, <class
'NVDAObjects.window.edit.RichEdit'>, <class
'NVDAObjects.window.edit.Edit'>, <class
'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class
'NVDAObjects.behaviors.EditableText'>, <class
'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>,
<class 'globalPlugins.indent_nav.EditableIndentNav'>, <class
'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>,
<class 'baseObject.ScriptableObject'>, <class
'baseObject.AutoPropertyObject'>, <class
'garbageHandler.TrackedObject'>, <class 'object'>)", 'description:
None', 'location: RectLTWH(left=2, top=117, width=1916, height=839)',
"value: '














Stefan Moisei
 

Ah, I see. thanks for the help, but it doesn't work for my case. I don't want to create new links, rather, I want to extract them from an already created text box. can't use html as I have to work with an existing app.
Thankks anyway.

------ Original Message ------
From: "Noelia Ruiz" <nrm1977@...>
To: nvda-addons@nvda-addons.groups.io
Sent: 19.09.2022 19:34:37
Subject: Re: [nvda-addons] GET link from riche edit

I was trying to suggest you to see the code, without thinking about
something precise.
I've been playing with wx.TE_AUTO_URL style in the readonly multiline
edit box of views.py in addonStoreGui, but this seems not to be useful
to create links.
In readFeeds add-on, I use just an HTML file with JavaScript to show
links and other controls. In this way we can use browse mode to read,
andwrite HTML with known and documented procedures, in case this helps
you if you prefer not to use wx edit boxes.
https://github.com/nvdaes/readFeeds
Cheers

2022-09-19 13:21 GMT+02:00, Stefan Moisei via groups.io
<vor_tex123@...>:
Seems ok for my case. I am trying to ghet the focused link from a
richedit, since it is an audio file and I want to play it with a
keyboard shortcut, without opening it.
In your example, I found in views.py a method to add a link to the end
of a text box... is this what you meant, or is there a method to
extract links, too?
Thanks.
------ Original Message ------
From: "Noelia Ruiz" <nrm1977@...>
To: nvda-addons@nvda-addons.groups.io
Sent: 16.09.2022 06:58:32
Subject: Re: [nvda-addons] GET link from riche edit

Hi:

The only way that I can think now is to find strings of text that
maybe reported as links in certain controls. But I believe that more
robust solutions can be provided.
For reference, in case code is useful to find out this, another
example maybe found in this pull request:
https://github.com/nvaccess/nvda/pull/13985


2022-09-15 16:01 GMT+02:00, Stefan Moisei via groups.io
<vor_tex123@...>:
hello,
riche edit text fields seem to contain links that are recognised by
NVDA, since I hear link and out of link when traversing them. How to
programatically get the link, though? object dev info doesn't show
anything useful. can I do it via text info, or is there some custom API
for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better
understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states:
State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable: True',
'hasFocus: False', 'Python object:

<NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav

object at 0x0D3566D0>', "Python class mro: (<class

'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>,

<class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>, <class
'globalPlugins.ndtt.logReader.LogContainer'>, <class
'NVDAObjects.IAccessible.IAccessible'>, <class
'NVDAObjects.window.edit.RichEdit50'>, <class
'NVDAObjects.window.edit.RichEdit'>, <class
'NVDAObjects.window.edit.Edit'>, <class
'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class
'NVDAObjects.behaviors.EditableText'>, <class
'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>,
<class 'globalPlugins.indent_nav.EditableIndentNav'>, <class
'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>,
<class 'baseObject.ScriptableObject'>, <class
'baseObject.AutoPropertyObject'>, <class
'garbageHandler.TrackedObject'>, <class 'object'>)", 'description:
None', 'location: RectLTWH(left=2, top=117, width=1916, height=839)',
"value: '

















Noelia Ruiz
 

Ah, ok. Hope at least you can get it find patterns of text in the text
box or someone provides a better answer.
Good luck.

2022-09-19 18:42 GMT+02:00, Stefan Moisei via groups.io
<vor_tex123@...>:

Ah, I see. thanks for the help, but it doesn't work for my case. I don't
want to create new links, rather, I want to extract them from an already
created text box. can't use html as I have to work with an existing app.
Thankks anyway.

------ Original Message ------
From: "Noelia Ruiz" <nrm1977@...>
To: nvda-addons@nvda-addons.groups.io
Sent: 19.09.2022 19:34:37
Subject: Re: [nvda-addons] GET link from riche edit

I was trying to suggest you to see the code, without thinking about
something precise.
I've been playing with wx.TE_AUTO_URL style in the readonly multiline
edit box of views.py in addonStoreGui, but this seems not to be useful
to create links.
In readFeeds add-on, I use just an HTML file with JavaScript to show
links and other controls. In this way we can use browse mode to read,
andwrite HTML with known and documented procedures, in case this helps
you if you prefer not to use wx edit boxes.
https://github.com/nvdaes/readFeeds
Cheers

2022-09-19 13:21 GMT+02:00, Stefan Moisei via groups.io
<vor_tex123@...>:
Seems ok for my case. I am trying to ghet the focused link from a
richedit, since it is an audio file and I want to play it with a
keyboard shortcut, without opening it.
In your example, I found in views.py a method to add a link to the end
of a text box... is this what you meant, or is there a method to
extract links, too?
Thanks.
------ Original Message ------
From: "Noelia Ruiz" <nrm1977@...>
To: nvda-addons@nvda-addons.groups.io
Sent: 16.09.2022 06:58:32
Subject: Re: [nvda-addons] GET link from riche edit

Hi:

The only way that I can think now is to find strings of text that
maybe reported as links in certain controls. But I believe that more
robust solutions can be provided.
For reference, in case code is useful to find out this, another
example maybe found in this pull request:
https://github.com/nvaccess/nvda/pull/13985


2022-09-15 16:01 GMT+02:00, Stefan Moisei via groups.io
<vor_tex123@...>:
hello,
riche edit text fields seem to contain links that are recognised by
NVDA, since I hear link and out of link when traversing them. How to
programatically get the link, though? object dev info doesn't show
anything useful. can I do it via text info, or is there some custom
API
for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better
understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states:
State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable:
True',
'hasFocus: False', 'Python object:


<NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav

object at 0x0D3566D0>', "Python class mro: (<class


'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>,

<class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>,
<class
'globalPlugins.ndtt.logReader.LogContainer'>, <class
'NVDAObjects.IAccessible.IAccessible'>, <class
'NVDAObjects.window.edit.RichEdit50'>, <class
'NVDAObjects.window.edit.RichEdit'>, <class
'NVDAObjects.window.edit.Edit'>, <class
'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class
'NVDAObjects.behaviors.EditableText'>, <class
'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>,
<class 'globalPlugins.indent_nav.EditableIndentNav'>, <class
'NVDAObjects.NVDAObject'>, <class
'documentBase.TextContainerObject'>,
<class 'baseObject.ScriptableObject'>, <class
'baseObject.AutoPropertyObject'>, <class
'garbageHandler.TrackedObject'>, <class 'object'>)", 'description:
None', 'location: RectLTWH(left=2, top=117, width=1916,
height=839)',
"value: '






















Tony Malykh
 

Try this: first compute textInfo t that starts on that link, then:

>>> t.NVDAObjectAtStart.value

Works in MS word for me.

HTH

--Tony


On 9/15/2022 7:01 AM, Stefan Moisei via groups.io wrote:

hello,
riche edit text fields seem to contain links that are recognised by NVDA, since I hear link and out of link when traversing them. How to programatically get the link, though? object dev info doesn't show anything useful. can I do it via text info, or is there some custom API for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states: State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable: True', 'hasFocus: False', 'Python object: <NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav object at 0x0D3566D0>', "Python class mro: (<class 'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>, <class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>, <class 'globalPlugins.ndtt.logReader.LogContainer'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.edit.RichEdit50'>, <class 'NVDAObjects.window.edit.RichEdit'>, <class 'NVDAObjects.window.edit.Edit'>, <class 'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class 'NVDAObjects.behaviors.EditableText'>, <class 'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>, <class 'globalPlugins.indent_nav.EditableIndentNav'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", 'description: None', 'location: RectLTWH(left=2, top=117, width=1916, height=839)', "value: '


Stefan Moisei
 

hmm, the question is how to get the start of the link... are there smarter methods than looking forr "http"? :)
Thanks.

------ Original Message ------
From: "Tony Malykh" <anton.malykh@...>
Sent: 23.09.2022 01:53:37
Subject: Re: [nvda-addons] GET link from riche edit

Try this: first compute textInfo t that starts on that link, then:

>>> t.NVDAObjectAtStart.value

Works in MS word for me.

HTH

--Tony


On 9/15/2022 7:01 AM, Stefan Moisei via groups.io wrote:
hello,
riche edit text fields seem to contain links that are recognised by NVDA, since I hear link and out of link when traversing them. How to programatically get the link, though? object dev info doesn't show anything useful. can I do it via text info, or is there some custom API for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states: State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable: True', 'hasFocus: False', 'Python object: <NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav object at 0x0D3566D0>', "Python class mro: (<class 'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>, <class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>, <class 'globalPlugins.ndtt.logReader.LogContainer'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.edit.RichEdit50'>, <class 'NVDAObjects.window.edit.RichEdit'>, <class 'NVDAObjects.window.edit.Edit'>, <class 'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class 'NVDAObjects.behaviors.EditableText'>, <class 'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>, <class 'globalPlugins.indent_nav.EditableIndentNav'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", 'description: None', 'location: RectLTWH(left=2, top=117, width=1916, height=839)', "value: '


Tony Malykh
 

You can find link like this:

1. ff = textInfo.getTextWithFields()

2. Find index of the first element in ff that has f.field['role'] == Role.LINK.

3. To figure out the offset of the link, find all f in ff before that index such that isinstance(f, str) and sum up their length.

4. textInfo.collapse()

5. textInfo.move('character', offset)

HTH


On 9/25/2022 8:42 AM, Stefan Moisei via groups.io wrote:

hmm, the question is how to get the start of the link... are there smarter methods than looking forr "http"? :)
Thanks.
------ Original Message ------
From: "Tony Malykh" <anton.malykh@...>
Sent: 23.09.2022 01:53:37
Subject: Re: [nvda-addons] GET link from riche edit

Try this: first compute textInfo t that starts on that link, then:

>>> t.NVDAObjectAtStart.value

Works in MS word for me.

HTH

--Tony


On 9/15/2022 7:01 AM, Stefan Moisei via groups.io wrote:
hello,
riche edit text fields seem to contain links that are recognised by NVDA, since I hear link and out of link when traversing them. How to programatically get the link, though? object dev info doesn't show anything useful. can I do it via text info, or is there some custom API for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states: State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable: True', 'hasFocus: False', 'Python object: <NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav object at 0x0D3566D0>', "Python class mro: (<class 'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>, <class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>, <class 'globalPlugins.ndtt.logReader.LogContainer'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.edit.RichEdit50'>, <class 'NVDAObjects.window.edit.RichEdit'>, <class 'NVDAObjects.window.edit.Edit'>, <class 'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class 'NVDAObjects.behaviors.EditableText'>, <class 'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>, <class 'globalPlugins.indent_nav.EditableIndentNav'>, <class 'NVDAObjects.NVDAObject'>, <class 'documentBase.TextContainerObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <class 'garbageHandler.TrackedObject'>, <class 'object'>)", 'description: None', 'location: RectLTWH(left=2, top=117, width=1916, height=839)', "value: '


Beqa Gozalishvili
 

It is not working like that in richedit controls.
It works in ms word, but nt in simple richedit controls.

As i understand, however it is not an effective way doing this, but
getting textinfo from carret and traversing to right and left from
current cursos untill field will not have link in it and then filter
it.

On 9/25/22, Tony Malykh <anton.malykh@...> wrote:
You can find link like this:

1. ff = textInfo.getTextWithFields()

2. Find index of the first element in ff that has f.field['role'] ==
Role.LINK.

3. To figure out the offset of the link, find all f in ff before that
index such that isinstance(f, str) and sum up their length.

4. textInfo.collapse()

5. textInfo.move('character', offset)

HTH


On 9/25/2022 8:42 AM, Stefan Moisei via groups.io wrote:
hmm, the question is how to get the start of the link... are there
smarter methods than looking forr "http"? :)
Thanks.
------ Original Message ------
From: "Tony Malykh" <anton.malykh@...>
To: nvda-addons@nvda-addons.groups.io
Sent: 23.09.2022 01:53:37
Subject: Re: [nvda-addons] GET link from riche edit

Try this: first compute textInfo t that starts on that link, then:

t.NVDAObjectAtStart.value
Works in MS word for me.

HTH

--Tony


On 9/15/2022 7:01 AM, Stefan Moisei via groups.io wrote:
hello,
riche edit text fields seem to contain links that are recognised by
NVDA, since I hear link and out of link when traversing them. How to
programatically get the link, though? object dev info doesn't show
anything useful. can I do it via text info, or is there some custom
API for riche edit text ffields?
thanks. some dev info for the rich edit follows, so yu can better
understand what I am talking about:
['name: None', 'role: Role.EDITABLETEXT', 'roleText: None', 'states:
State.MULTILINE, State.FOCUSABLE, State.READONLY', 'isFocusable:
True', 'hasFocus: False', 'Python object:
<NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav

object at 0x0D3566D0>', "Python class mro: (<class
'NVDAObjects.Dynamic_EditableTextLogContainerIAccessibleRichEdit50WindowNVDAObjectEditableIndentNav'>,

<class 'globalPlugins.ndtt.logReader.EditableTextLogContainer'>,
<class 'globalPlugins.ndtt.logReader.LogContainer'>, <class
'NVDAObjects.IAccessible.IAccessible'>, <class
'NVDAObjects.window.edit.RichEdit50'>, <class
'NVDAObjects.window.edit.RichEdit'>, <class
'NVDAObjects.window.edit.Edit'>, <class
'NVDAObjects.behaviors.EditableTextWithAutoSelectDetection'>, <class
'NVDAObjects.behaviors.EditableText'>, <class
'editableText.EditableText'>, <class 'NVDAObjects.window.Window'>,
<class 'globalPlugins.indent_nav.EditableIndentNav'>, <class
'NVDAObjects.NVDAObject'>, <class
'documentBase.TextContainerObject'>, <class
'baseObject.ScriptableObject'>, <class
'baseObject.AutoPropertyObject'>, <class
'garbageHandler.TrackedObject'>, <class 'object'>)", 'description:
None', 'location: RectLTWH(left=2, top=117, width=1916,
height=839)', "value: '




--
with best regards Beqa Gozalishvili
Tell: +995593454005
Email: beqaprogger@...
Web: https://gozaltech.org
Skype: beqabeqa473
Telegram: https://t.me/gozaltech
facebook: https://facebook.com/gozaltech
twitter: https://twitter.com/beqabeqa473
Instagram: https://instagram.com/beqa.gozalishvili