Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Edit with clickable URLs


  • Please log in to reply
6 replies to this topic
Azevedo
  • Members
  • 179 posts
  • Last active: Nov 04 2015 04:37 PM
  • Joined: 07 Mar 2012

Is there a way to put an edit with clickable hyperlinks in it?

Thanks



sporefreak
  • Members
  • 3 posts
  • Last active: Dec 23 2015 07:31 AM
  • Joined: 28 Oct 2015

I'm not sure what you are asking. could you elaborate a bit more?



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

I assume you need a rich text format edit field? Try out these links (I haven't thoroughly reviewed them to make sure they're what you're looking for)

 

http://autohotkey.co...s/?hl=rich text

http://autohotkey.co...f/?hl=rich text



Azevedo
  • Members
  • 179 posts
  • Last active: Nov 04 2015 04:37 PM
  • Joined: 07 Mar 2012

I mean  a regular text component with the ability to get urls in it clickable.

 

Exaskryz:

hmm richtext may fit! Thanks!

But all those links in that page are giving error 404.

I didn't find a working example of a rich text.



garry
  • Spam Officer
  • 3219 posts
  • Last active: Sep 20 2018 02:47 PM
  • Joined: 19 Apr 2005

an old script

select first for folder and then allows to search in txt,ahk,bas, -files

example type in http://  and then found http:// which is clickable

 

-shows Line-1

-shows Line-0 found http://www.xyz.com or [email protected]  ; << this is clickable but not blue (doubleclick)

-shows Line+1

;MODIFIED=20110627
;CREATED =20070130

#NoEnv
SetBatchLines, -1

autotrim,off
transform,S,chr,32

;EXT=.ahk

Gui,1:Font,  S10 CDefault , FixedSys
Gui,1:default

SW=%A_screenwidth%
SH=%A_screenheight%
DW :=(SW*99)/100
DH :=(SH*50)/100
DIF:=(SH* 1)/100
LVW:=(DW-(1*DIF))
LVH:=(DH-(5*DIF))

BT1:=(DH-(3*DIF))
T1 :=(LVW-DIF)

RU2=%A_SCRIPTDIR%\_SETTINGS
ifnotexist,%RU2%
FileCreateDir,%RU2%
DFT=%RU2%\define.txt
ifnotexist,%DFT%
  fileappend,%A_scriptdir%,%DFT%

FileReadLine,MF,%DFT%,1

;msgbox,%MF%

menu,S1,Add,&Set a predefined Folder,MH1
menu,S1,Add,&About,MH3
menu,myMenuBar,Add,Settings,:S1
gui,1:menu,MyMenuBar


Gui,1:Add,Edit,  x10   y%BT1% w180 h20 vWordToSearch
;Gui,1:Add,Button,x200  y%BT1% w0   h0 gSEARCH2 default,

Gui,1:Add,Button,x200  y%BT1% w110   h25 gSEARCH2a,String
Gui,1:Add,Button,x330  y%BT1% w250   h25 gSEARCH2b,2-Words separated by comma

Gui,1:Add,Edit,  x710  y%BT1% w90 h20 readonly right vCount1
Gui,1:Add,Edit,  x810  y%BT1% w90 h20 readonly right vTickCNT


Gui,1:Add, ListView,grid backgroundD4D0C8 x0 y0 w%LVW% h%LVH% +hscroll altsubmit gLW2 vLW1,SCRIPT
LV_ModifyCol(1,T1)
Gui,1:Show,x0 y0 w%DW% h%DH%,Search for a word and open text  [doubleclick start program or open URL]  [ KEY=f opens folder ]  [Search for 1  or  2 Words ]
return
;-------------------------------------------------------------------------------------------------


Guiclose:
Exitapp
;-------------








;search2:
search2a:
Gui,1:submit,nohide
Gui,1:Default
string=1
2words=0
goto,AAX2

search2b:
Gui,1:submit,nohide
Gui,1:Default
string=0
2words=1

AAX2:



LV_Delete()
PathToSearch = %MF%\
Z1===========================================================================================================
XM1=-1=
XMM=_0=
XMP=+1=

;Loop,%PathToSearch%*%EXT%,0,1

data=
data1=
data2=
IX=0
StringSplit, data, WordToSearch, %s%
loop,%data0%
     IX++


GuiControl,1:Text,Count1 ,
GuiControl,1:Text,TickCNT,
xt=0
IZ=0
StartTime := A_TickCount
Splashimage,,b1 x140 y0 w500 h30 CWGreen zh0,SEARCH
GuiControl,1: -Redraw,LW1
Loop,%PathToSearch%*,0,1
{
   Loop Read, %A_LoopFileFullPath%
   {
   SplitPath, A_LoopFileFullPath,,, Extension
      If Extension Not In bas,txt,ahk                  ;<<<< search for extensions
         Continue


      if FOUND=1
          {
         iz++
         LV_Add("",A_LoopReadLine)       ;Next Line Plus1
         LV_Add("",Z)                    ;NOTHING
         FOUND=
         GuiControl,1:Text,Count1 ,%iz%
          }

      ; IfInString A_LoopReadLine, %WordToSearch%
      ; if A_LoopReadLine contains %WordToSearch%
      ; If InStr(A_LoopReadLine,WordToSearch)


ok9=0
if 2words=1
  {
  ok9=0
  if IX=2
      {
      ok1=0
      ok2=0
      ok9=0
      if A_LoopReadLine contains %data1%
         ok1:=1
      if A_LoopReadLine contains %data2%
         ok2:=1
      ok9:=(ok1+ok2)
      }
  }

if string=1
  {
  If InStr(A_LoopReadLine,WordToSearch)
     ok9:=2
  }

      if (ok9=2)
      {
         I++
         ALF=%A_LoopFileFullPath%
         if ALF<>%ALF1%
             {
             ;write once
             LV_Add("",Z1)
             LV_Add("",ALF)             ;filename
             }

         LV_Add("",ALF11)            ;Line minus 1
         LV_Add("",A_LoopReadLine)   ;searched

         ALF1=%A_LoopFileFullPath%
         FOUND=1
      }
    ALF11=%A_LoopReadLine%               ;LINE minus 1
   }
}

; Nothing found?
NFX=------- Nothing Found -----------
if I<1
LV_Add("",NFX)


xt:=(A_TickCount-StartTime)/1000
xt:=floor(xt)

GuiControl,1:Text,Count1 ,%iz%
GuiControl,1:Text,TickCNT,%xt%-sec

Splashimage,off
GuiControl,1: +Redraw,LW1
ALF=
ALF1=
NFX=
Z=
PathToSearch=
WordToSearch=
Return
;--------------------------------------------------------------------






;---------------------------------------------------------------------
MH3:
msgbox,SearchText.ahk 2007-01-30-- garry`r`nhttp://www.autohotkey.com
return

MH1:
MF=
FileSelectFolder,MF,,3
if MF=
return
Filedelete,%DFT%
fileappend,%MF%,%DFT%
return
;========================================================================



;========================================================================
LW2:
;GuiControlGet,LW1
;Gui,1:submit,nohide
Gui,1:default


if A_GuiEvent=normal
{
     LV_GetText(C1,A_EventInfo,1)
     stringmid,C1a ,C1,2,2          ;-  :\

      RN:=LV_GetNext("C")
      RF:=LV_GetNext("F")
      GC:=LV_GetCount()
return
}




;--------------------
 if A_GuiEvent=K
 {
 GetKeyState,state,f            ;-  open folder
  if state=D
     {
     if C1a=:\
           {
           SplitPath,C1, name, dir2, ext, name_no_ext, drive
           run,%dir2%
           }
     }
 return
 }
;---------------------




;--------------------------------
if A_GuiEvent=Rightclick
{
A=http://
B=:\
[email protected]
LV_GetText(C1,A_EventInfo,1)
    RN:=LV_GetNext("C")  ;2  selected checked
    RF:=LV_GetNext("F")  ;2  selected focused
    GC:=LV_GetCount()    ;4  total

IfInString,C1,%B%
   {
   SplitPath,C1,name1, dir, ext, name_no_ext, drive
   if ext=ahk
      {
      run,notepad %C1%
      return
      }

   }
return
}
;------------------------------









;----------------------------
if A_GuiEvent=Doubleclick
{
A=http://
B=:\
[email protected]
LV_GetText(C1,A_EventInfo,1)
stringmid,C1a ,C1,2,2          ;-  :\

    RN:=LV_GetNext("C")  ;2  selected checked
    RF:=LV_GetNext("F")  ;2  selected focused
    GC:=LV_GetCount()    ;4  total


IfInString,C1,%A%
   {
     {
     StringGetPos,P1,C1,http://
     P1:=P1+1
     }
    stringlen,L2,C1
    P2:=(L2-(P1-1))
    stringmid,A6,C1,P1,P2
    T=%A6%
    StringReplace t,T,.%A_Space%,`,,All
    StringRight r,t,1
    IfEqual r,., StringTrimRight t,t,1
    Loop Parse,t,`,` `"`;`!`<`>
       {
       StringLeft r,A_LoopField,7
       If r=%A%
       run,%A_LoopField%
       return
       }
   }


IfInString,C1,%B%
   {
     {
     StringGetPos,P1,C1,:\
     P1:=P1
     }

    stringlen,L2,C1
    P2:=(L2-(P1-1))
    stringmid,A6,C1,P1,P2
    T=%A6%
    ;msgbox,%T%
    StringReplace t,T,.%A_Space%,`,,All
    StringRight r,t,1
    IfEqual r,., StringTrimRight t,t,1
    Loop Parse,t,`,`"`;`!`<`>
       {
       stringmid,r,A_LoopField,2,2
       If r=%B%
       run,%A_LoopField%
       return
       }
   }



;------------ SEARCH FOR EMAIL ----------------
IfInString,C1,%E%
   {
   StringSplit,D,C1,%S%
   loop %D0%
        {
   CX=D%A_INDEX%
   If %CX% contains @
            {
          DX:=D%A_INDEX%
          run,mailto:%DX%?subject=Greetings&Body=Hallo
          return
            }
        }
   }
return
}
return
;-----------------------------------------------


;- esc::exitapp



tank
  • Administrators
  • 4345 posts
  • AutoHotkey Foundation
  • Last active: May 02 2019 09:16 PM
  • Joined: 21 Dec 2007

elaborate

the answer may be much simpler .

if the text has only the link or that would be the only reason to click it you could simply use a glabel and call the link in the text. 


Never lose.
WIN or LEARN.

space
  • Members
  • 520 posts
  • Last active:
  • Joined: 12 Aug 2014
For RichEdit just me is probably the most recent version of such a control which works (unicode only it seems) http://ahkscript.org...c.php?f=6&t=681