Re: openLinkWith put links in a dialog to be opened with


Ibrahim Hamadeh
 

hello brian and all
Really there was a bug in the regular expression responsible for parsing
the text
and it is now hopefully fixed
the link for the addon is:
https://github.com/ibrahim-s/openLinkWith/releases/download/v1.0/OpenLinkWith-1.0.nvda-addon
you can test it clearly in the readme.md file in nvda addon template folder
select all and press the addon command
you will notice that all urls are cleanly extracted.
thank you
best regards
ibrahim

On 01-Oct-17 5:52 PM, Ibrahim Hamadeh wrote:
hello Brian
yes, sorry for that
I have experienced that also
and really I am trying to review the regular expression used for parsing
the text
hope I can fix it
thank you for your testing and remarks
ibrahim.


On 01-Oct-17 1:10 PM, Brian's Mail list account via Groups.Io wrote:
Hi, could I just say that if you use this on an email from the .io
users list, some of the links append text to the end that makes them
invalid when clicked. Not sure what is going on here myself. but the
links in the email as sent dowork correctly. I was using Outlook
express but suspect any mshtml display might be the same.
Could it be that carriage returns are seen as nothing and then it
moves on to the next space?
Try the donate link.
I also think its missing some links.

Maybe it only works in other text displays but I did select all then
invoked the add on.
Brian

bglists@blueyonder.co.uk
Sent via blueyonder.
Please address personal email to:-
briang1@blueyonder.co.uk, putting 'Brian Gaff'
in the display name field.
----- Original Message ----- From: "Ibrahim Hamadeh"
<ibra.hamadeh@hotmail.com>
To: <nvda-addons@nvda-addons.groups.io>
Sent: Thursday, September 28, 2017 8:49 PM
Subject: Re: [nvda-addons] openLinkWith put links in a dialog to be
opened with


hello James
In the addon files there is a module named urlfinder.py uses regular
expressions
parses the selected text to get the urls out of it.
the addon then shows the links in a dialog, along with buttons for
browsers found on pc
if pressed on a link in the list, it will be opened with default browser
in the addon I used the webbrowser module, and also subprocess module.
your thoughts for extending the addon are really beautiful
especially adding an edit field that works as address bar
but as you have said let's first stand on a starting point
and if things worked ,we may then move ahead.
thank you for your advice about packaging the addon
and really thank you for all recommendations and thoughts
greetings
ibrahim


On 28-Sep-17 9:14 PM, James Scholes wrote:
It all depends what you're trying to accomplish. I'd suggest that as
a base, you focus on:

1. Parsing links from a piece of text;
2. Showing the links in a dialog;
3. Allowing the user to open one of the links in their default browser.

For that, you should use Python's webbrowser module. It's had years
of testing and it uses the same APIs used by Windows when you type a
URL into the Run dialog. This will create a good user experience
without surprises.

If you then want to extend the add-on's functionality, here are some
ideas:

1. Allow the user to set a specific browser path which will be passed
the URL as a command line argument.
2. Allow the user to create their own regular expressions for parsing
links in the text, e.g. Spotify track links or links to FTP sites.
3. Extend the above by allowing the user to set specific browser paths
for different link types, for example it doesn't make much sense to
open Spotify links in Firefox.

These are just some ideas, and as with any project there are probably
countless others. But I would definitely say that as a starting
point, you should focus on parsing HTTP and HTTPS links out of some
text, and then allowing them to be opened in the user's default
browser. You should also avoid trying to work out which browser that
should be, or limiting your add-on to only work with commonly
installed browsers in common locations. Once that's working, you can
share it, perhaps even get it put up on the NVDA Add-Ons page, and
people will give you feedback on how they're personally using it.

On one final note, if you want people to test your add-ons, please
package them as .nvda-addon files, not RAR archives.

Regards,

James Scholes
https://twitter.com/JamesScholes



.




.

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