Author Topic: How to setup : single click to select url  (Read 1316 times)

Offline false007

  • Registered User
  • Jr. Member
  • *
  • Posts: 60
  • Karma: +0/-0
    • View Profile
How to setup : single click to select url
« on: August 19, 2014, 09:46:47 am »
Hello,

How to setup : single click to select url.


Thanks a lot.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2171
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: How to setup : single click to select url
« Reply #1 on: August 22, 2014, 12:07:53 am »
I do not see any built-in option for it now.
Probable solutions can be:
  • Use Expand selection on URL Alt+Down will select URL in 2-3 presses.
  • Write simple plugin, with command to select an url under cursor -> regular expression will do it easy. But still not with mouse (catching mouse actions not possible with plugins).

Offline false007

  • Registered User
  • Jr. Member
  • *
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: How to setup : single click to select url
« Reply #2 on: August 22, 2014, 01:46:27 am »
This pattern can math the url : (http://|www.)(.*?)(?= |\r\n|'|")

but  I could't write the plug now, It's very bad.

When I'm  not buzy,  perhaps will write the plug which match the url.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2171
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: How to setup : single click to select url
« Reply #3 on: August 22, 2014, 11:20:57 am »
Install Scripting Tools plugin and use the wizard to create "New Service Script".
It will help you to create a stub for your command in a second.
To read text under cursor and change selection check API page on wiki: http://wiki.hippoedit.com/scripting/api/start . You need IApplication + IDocument + IView.
Bellow is some code you can reuse for start
Code: Javascript
  1.         var sel = ActiveView.Selection;
  2.  
  3.         // if there is no selection, take current word range as selection
  4.         if ( sel.IsEmpty )
  5.                 sel = new Range(0, 0, ActiveDocument.LineCount - 1, ActiveDocument.GetLineLength(ActiveDocument.LineCount - 1));
  6.         var text = ActiveDocument.GetText(sel);
  7.        ...
  8.       ActiveView.Selection = sel;
  9.  
taken from beautifier.hejs

 

Related Topics

  Subject / Started by Replies Last post
5 Replies
2020 Views
Last post July 10, 2009, 04:37:50 pm
by rjbull
Single Window

Started by torann81 General Discussion

1 Replies
1580 Views
Last post September 27, 2009, 05:55:09 pm
by alex
3 Replies
3357 Views
Last post February 25, 2011, 12:31:32 am
by alex
0 Replies
1802 Views
Last post October 16, 2011, 06:38:55 pm
by alex
3 Replies
709 Views
Last post October 06, 2016, 11:19:56 pm
by alex