Convert File / Folder Paths into Hyperlinks / Shortcuts

Post your working scripts, libraries and tools for AHK v1.1 and older
Trisolaris
Posts: 79
Joined: 10 Mar 2019, 10:28

Convert File / Folder Paths into Hyperlinks / Shortcuts

Post by Trisolaris » 18 May 2022, 05:37

Hi everyone,

in my line of work, we have to share hyperlinks to files or folders on our LAN very frequently. Converting the file/folder paths to hyperlinks via the Ctrl+K method is too cumbersome IMO.

What does it do?
  • Select one or several files or folders on your desktop or in WinExplorer.
  • Press Win+P to get the corresponding file/folder paths into a string variable.
  • Switch to an MS Office App (PowerPoint, Outlook, Word, Excel, OneNote) and Press Ctrl+Alt+K to instantly insert hyperlinks to each selected item. The visible hyperlink text will be the file name and extension for each selected file, and the name of the last subfolder for each selected folder. This happens by converting the paths to html via the included libraries.
  • Since OneNote handles hyperlinks differently, a custom solution was included for that (albeit not as nice as the solution for the other Office apps)
  • Since Teams does not (yet) accept hyperlinks to local sources, the script sends the file/folder path as clear text there.
  • Pressing Ctr+Alt+K hotkey while on the desktop or in WinExplorer creates a shortcut to each selected item.
Credits: the code relies on...
  • The brilliant Explorer_GetSelection() and GetDesktopIShellFolderViewDual() COM-based functions by @teadrinker
Known issues & feedback:
  • The operations relying on the included libraries are a bit slow. I've included sleep times to improve reliability. If you know ways to boost speed and reliability, kindly share!
  • This is the first utility script I share with you folks, so please don't burn me if I didn't find the most elegant way of coding it.
  • Any feedback is much appreciated.

Code: Select all

;Credits to teadrinker for the Explorer_GetSelection() and GetDesktopIShellFolderViewDual() COM-based functions
;Credits to Deo for the WinClipAPI and WinClip libraries which must be included for this to work
#NoEnv
#SingleInstance, Force
Tooltip, Loaded
Sleep, 5000
ToolTip
#Include <WinClipAPI> ;Includes the WinClipAPI library; must be included before WinClip lib below; https://www.autohotkey.com/board/topic/74670-class-winclip-direct-clipboard-manipulations/
Sleep, 1000
#Include <WinClip> ;Includes the WinClip library; https://www.autohotkey.com/boards/viewtopic.php?f=76&t=69581&hilit=WinClip.SetHTML+WinClip.SetText
If (A_IsCompiled = "") ;Following block will only be read if the script was not compiled into an exe file
{
	If FileExist("C:\Program Files (x86)\Notepad++\notepad++.exe")
		Menu, Tray, Add , Edit with Notepad++, Edit++
	Else 
		Menu, Tray, Add, Edit, Edit
}
Return

#p::
;Credits to teadrinker for the Explorer_GetSelection() and GetDesktopIShellFolderViewDual() COM-based functions
HLArray := "" ;Empties array
HLArray := StrSplit(Explorer_GetSelection() , "`n") ;Splits the string output by the GetSelection() function into an array
MsgBox, 64, , % "Copied " . HLArray.MaxIndex() . " path(s)", 1 ;Message window shows how many paths were copied
return

^!k:: ;Inserts hyperlinks or shortcuts to previously selected folders and files
	IfWinActive, ahk_exe Explorer.exe
		GoTo, InsertShortcut
	Else
		GoTo, InsertHL
	Return

InsertHL:
	For index, value in HLArray ;Loops through all values in the HLArray
	{
		; MsgBox % "Item " index " is '" value "'" ;Debug
		WinClip.Clear() ;Clears clipboard; WinClipAPI & WinClip libraries
		WinClip.SetText(value) ;Stores value of current item of HLArray as text; WinClipAPI & WinClip libraries
		HLString := StrReplace(value, A_Space, "%20") ;Replaces spaces inside the value with %20. This is necessary for hyperlinks
		Sleep, 600
		HLText := SubStr(value, InStr(value, "\", false, -1, 1)+1) ;Visible text of the hyperlink = substring to the right of "/" inside value of current array item 
		; MsgBox, HLText = %HLText% ;Debug
		WinClip.SetHTML("<a href=" . HLString . ">" . HLText . "</a>") ;Converts the clipboard entry to an HTML; WinClipAPI & WinClip libraries
		Sleep, 100
		IfWinActive, ahk_exe ONENOTE.EXE
			Send, file:///%HLString% ;OneNote handles hyperlinks differently from other Office apps
		IfWinActive, ahk_exe Teams.exe
			Send, %value% ;File paths to local or network drive do not work in Teams; This line sends the initial path as text
		If (WinActive("ahk_exe ONENOTE.EXE") + WinActive("ahk_exe Teams.exe") < 1) ;If active window is neither OneNote nor Teams
			WinClip.Paste() ;Pastes the HTML-converted HLString
		If (index < HLArray.MaxIndex()) ;If there is at least one more item in the array
		{
			IfWinActive, ahk_exe Teams.exe
				Send, +{Enter} ;Sends Shift+Enter
			Else
				Send, `n ;Sends line break
		}
		Else ;If this is the last item in the array
		{
			IfWinActive, ahk_exe EXCEL.EXE
				Send, `n ;Sends line breat after last entry to avoid overwriting the last inserted hyperlink with a space
			Else 
				Send, %A_Space% ;Sends space after last entry in all apps but Excel (sending space there would overwrite the cell content)
		}
	}
	Return

InsertShortcut: ;Inserts shortcuts to previously selected folders and files via Ctr+Alt+k
	TargetLocation := Explorer_GetSelection()
	For index, value in HLArray ;Loops through all values in the HLArray
	{
		ShortcutText := SubStr(value, InStr(value, "\", false, -1, 1)+1) ;Visible text of the hyperlink = substring to the right of "/" inside value of current array item 
		LinkFile := TargetLocation . "\" . ShortcutText
		IfWinActive, ahk_exe Explorer.exe
			FileCreateShortcut, %value%, %LinkFile%.lnk
	}
	Return

Explorer_GetSelection() 
{
   WinGetClass, winClass, % "ahk_id" . hWnd := WinExist("A")
   if (winClass ~= "Progman|WorkerW")
      oShellFolderView := GetDesktopIShellFolderViewDual()
   else if (winClass ~= "(Cabinet|Explore)WClass") 
   {
      for window in ComObjCreate("Shell.Application").Windows
         if (hWnd = window.HWND) && (oShellFolderView := window.document)
            break
   }
   else
      Return
   
   for item in oShellFolderView.SelectedItems
      result .= (result = "" ? "" : "`n") . item.path
   if !result
      result := oShellFolderView.Folder.Self.Path
   Return result
}

GetDesktopIShellFolderViewDual()
{
    IShellWindows := ComObjCreate("{9BA05972-F6A8-11CF-A442-00A0C90A8F39}")
    desktop := IShellWindows.Item(ComObj(19, 8)) ; VT_UI4, SCW_DESKTOP                
   
    ; Retrieve top-level browser object.
    if ptlb := ComObjQuery(desktop
        , "{4C96BE40-915C-11CF-99D3-00AA004AE837}"  ; SID_STopLevelBrowser
        , "{000214E2-0000-0000-C000-000000000046}") ; IID_IShellBrowser
    {
        ; IShellBrowser.QueryActiveShellView -> IShellView
        if DllCall(NumGet(NumGet(ptlb+0)+15*A_PtrSize), "ptr", ptlb, "ptr*", psv) = 0
        {
            ; Define IID_IDispatch.
            VarSetCapacity(IID_IDispatch, 16)
            NumPut(0x46000000000000C0, NumPut(0x20400, IID_IDispatch, "int64"), "int64")
           
            ; IShellView.GetItemObject -> IDispatch (object which implements IShellFolderViewDual)
            DllCall(NumGet(NumGet(psv+0)+15*A_PtrSize), "ptr", psv
                , "uint", 0, "ptr", &IID_IDispatch, "ptr*", pdisp)
           
            IShellFolderViewDual := ComObjEnwrap(pdisp)
            ObjRelease(psv)
        }
        ObjRelease(ptlb)
    }
    return IShellFolderViewDual
}

SetClipboardHTML(HtmlBody, HtmlHead:="", AltText:="") {       ; v0.67 by SKAN on D393/D42B
Local  F, Html, pMem, Bytes, hMemHTM:=0, hMemTXT:=0, Res1:=1, Res2:=1   ; @ tiny.cc/t80706
Static CF_UNICODETEXT:=13,   CFID:=DllCall("RegisterClipboardFormat", "Str","HTML Format")

  If ! DllCall("OpenClipboard", "Ptr",A_ScriptHwnd)
    Return 0
  Else DllCall("EmptyClipboard")

  If (HtmlBody!="")
  {
      Html     := "Version:0.9`r`nStartHTML:00000000`r`nEndHTML:00000000`r`nStartFragment"
               . ":00000000`r`nEndFragment:00000000`r`n<!DOCTYPE>`r`n<html>`r`n<head>`r`n"
                         . HtmlHead . "`r`n</head>`r`n<body>`r`n<!--StartFragment -->`r`n"
                              . HtmlBody . "`r`n<!--EndFragment -->`r`n</body>`r`n</html>"

      Bytes    := StrPut(Html, "utf-8")
      hMemHTM  := DllCall("GlobalAlloc", "Int",0x42, "Ptr",Bytes+4, "Ptr")
      pMem     := DllCall("GlobalLock", "Ptr",hMemHTM, "Ptr")
      StrPut(Html, pMem, Bytes, "utf-8")

      F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","<html>", "Ptr") - pMem
      StrPut(Format("{:08}", F), pMem+23, 8, "utf-8")
      F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","</html>", "Ptr") - pMem
      StrPut(Format("{:08}", F), pMem+41, 8, "utf-8")
      F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","<!--StartFra", "Ptr") - pMem
      StrPut(Format("{:08}", F), pMem+65, 8, "utf-8")
      F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","<!--EndFragm", "Ptr") - pMem
      StrPut(Format("{:08}", F), pMem+87, 8, "utf-8")

      DllCall("GlobalUnlock", "Ptr",hMemHTM)
      Res1  := DllCall("SetClipboardData", "Int",CFID, "Ptr",hMemHTM)
  }

  If (AltText!="")
  {
      Bytes    := StrPut(AltText, "utf-16")
      hMemTXT  := DllCall("GlobalAlloc", "Int",0x42, "Ptr",(Bytes*2)+8, "Ptr")
      pMem     := DllCall("GlobalLock", "Ptr",hMemTXT, "Ptr")
      StrPut(AltText, pMem, Bytes, "utf-16")
      DllCall("GlobalUnlock", "Ptr",hMemTXT)
      Res2  := DllCall("SetClipboardData", "Int",CF_UNICODETEXT, "Ptr",hMemTXT)
  }

  DllCall("CloseClipboard")
  hMemHTM := hMemHTM ? DllCall("GlobalFree", "Ptr",hMemHTM) : 0

Return (Res1 & Res2)
}

Edit: ;Triggered by notification area context menu entry
	run, notepad.exe "%A_ScriptFullPath%"
	return
	
Edit++: ;Triggered by notification area context menu entry to edit in notepad++
	run, notepad++.exe "%A_ScriptFullPath%"
	return

teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: Convert File / Folder Paths into Hyperlinks / Shortcuts

Post by teadrinker » 18 May 2022, 08:58

Trisolaris wrote: Explorer_GetSelection() and GetDesktopIShellFolderViewDual() COM-based functions by @teadrinker
There is a more compact solution:

Code: Select all

$F1::MsgBox % Explorer_GetSelection()

Explorer_GetSelection() {
   WinGetClass, winClass, % "ahk_id" . hWnd := WinExist("A")
   if !(winClass ~= "^(Progman|WorkerW|(Cabinet|Explore)WClass)$")
      Return
   
   shellWindows := ComObjCreate("Shell.Application").Windows
   if (winClass ~= "Progman|WorkerW")  ; IShellWindows::Item:    https://goo.gl/ihW9Gm
                                       ; IShellFolderViewDual:   https://goo.gl/gnntq3
      shellFolderView := shellWindows.Item( ComObject(VT_UI4 := 0x13, SWC_DESKTOP := 0x8) ).Document
   else {
      for window in shellWindows       ; ShellFolderView object: https://is.gd/eyZ4zG
         if (hWnd = window.HWND) && (shellFolderView := window.Document)
            break
   }
   for item in shellFolderView.SelectedItems
      result .= (result = "" ? "" : "`n") . item.Path
   ;~ if !result
      ;~ result := shellFolderView.Folder.Self.Path
   Return result
}

Trisolaris
Posts: 79
Joined: 10 Mar 2019, 10:28

Re: Convert File / Folder Paths into Hyperlinks / Shortcuts

Post by Trisolaris » 18 May 2022, 15:40

teadrinker wrote:
18 May 2022, 08:58
There is a more compact solution:
Thanks, I'll try that out!

Does anyone have an idea how to speed up the library operations?

User avatar
JoeWinograd
Posts: 2179
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Convert File / Folder Paths into Hyperlinks / Shortcuts

Post by JoeWinograd » 18 May 2022, 16:13

teadrinker wrote:There is a more compact solution
Tested here...single file and multiple file selections...both worked perfectly! Thank you, teadrinker...great stuff! Regards, Joe

Trisolaris
Posts: 79
Joined: 10 Mar 2019, 10:28

Re: Convert File / Folder Paths into Hyperlinks / Shortcuts

Post by Trisolaris » 19 May 2022, 09:18

teadrinker wrote:
18 May 2022, 08:58
There is a more compact solution:
@teadrinker I just replaced Explorer_GetSelection() and GetDesktopIShellFolderViewDual() with the new Explorer_GetSelection() function.
This appears to have rendered the

Code: Select all

InsertShortcut: ;Inserts shortcuts to previously selected folders and files via Ctr+Alt+k
label non-functional. Trying to display the result of Explorer_GetSelection() in a MsgBox shows an empty variable. Am I missing something here?

teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: Convert File / Folder Paths into Hyperlinks / Shortcuts

Post by teadrinker » 19 May 2022, 09:28

The last function has one difference:

Code: Select all

   ;~ if !result
      ;~ result := shellFolderView.Folder.Self.Path
This part is commented out.

Trisolaris
Posts: 79
Joined: 10 Mar 2019, 10:28

Re: Convert File / Folder Paths into Hyperlinks / Shortcuts

Post by Trisolaris » 30 May 2022, 03:55

teadrinker wrote: ↑
19 May 2022, 15:28
The last function has one difference:
Code: Select all - Download - Toggle Line numbers

;~ if !result
;~ result := shellFolderView.Folder.Self.Path
This part is commented out.
Hello @teadrinker,
I've activated the commented code in your updated function. The Hyperlinks part works, but there's still an issue with shortcuts. Now the shortcuts are only created when I'm in an explorer window. When I'm on the desktop and fire the Explorer_GetSelection() function, it returns the desktop path as TargetLocation. Can you help me debug this? I really like the more compact code.

Here's the current code

Code: Select all

;Credits to teadrinker for the Explorer_GetSelection() and GetDesktopIShellFolderViewDual() COM-based functions
;Credits to Deo for the WinClipAPI and WinClip libraries which must be included for this to work
#NoEnv
#SingleInstance, Force
Tooltip, Loaded
Sleep, 5000
ToolTip
#Include <WinClipAPI> ;Includes the WinClipAPI library; must be included before WinClip lib below; https://www.autohotkey.com/board/topic/74670-class-winclip-direct-clipboard-manipulations/
Sleep, 1000
#Include <WinClip> ;Includes the WinClip library; https://www.autohotkey.com/boards/viewtopic.php?f=76&t=69581&hilit=WinClip.SetHTML+WinClip.SetText
Return

#p::
;Credits to teadrinker for the Explorer_GetSelection() and GetDesktopIShellFolderViewDual() COM-based functions
HLArray := "" ;Empties array
HLArray := StrSplit(Explorer_GetSelection() , "`n") ;Splits the string output by the GetSelection() function into an array
MsgBox, 64, , % "Copied " . HLArray.MaxIndex() . " path(s)", 1 ;Message window shows how many paths were copied
return

^!k:: ;Inserts hyperlinks or shortcuts to previously selected folders and files
	IfWinActive, ahk_exe Explorer.exe
		GoTo, InsertShortcut
	Else
		GoTo, InsertHL
	Return

InsertHL:
	For index, value in HLArray ;Loops through all values in the HLArray
	{
		; MsgBox % "Item " index " is '" value "'" ;Debug
		WinClip.Clear() ;Clears clipboard; WinClipAPI & WinClip libraries
		WinClip.SetText(value) ;Stores value of current item of HLArray as text; WinClipAPI & WinClip libraries
		HLString := StrReplace(value, A_Space, "%20") ;Replaces spaces inside the value with %20. This is necessary for hyperlinks
		Sleep, 600
		HLText := SubStr(value, InStr(value, "\", false, -1, 1)+1) ;Visible text of the hyperlink = substring to the right of "/" inside value of current array item 
		; MsgBox, HLText = %HLText% ;Debug
		WinClip.SetHTML("<a href=" . HLString . ">" . HLText . "</a>") ;Converts the clipboard entry to an HTML; WinClipAPI & WinClip libraries
		Sleep, 100
		IfWinActive, ahk_exe ONENOTE.EXE
			Send, file:///%HLString% ;OneNote handles hyperlinks differently from other Office apps
		IfWinActive, ahk_exe Teams.exe
			Send, %value% ;File paths to local or network drive do not work in Teams; This line sends the initial path as text
		If (WinActive("ahk_exe ONENOTE.EXE") + WinActive("ahk_exe Teams.exe") < 1) ;If active window is neither OneNote nor Teams
			WinClip.Paste() ;Pastes the HTML-converted HLString
		If (index < HLArray.MaxIndex()) ;If there is at least one more item in the array
		{
			IfWinActive, ahk_exe Teams.exe
				Send, +{Enter} ;Sends Shift+Enter
			Else
				Send, `n ;Sends line break
		}
		Else ;If this is the last item in the array
		{
			IfWinActive, ahk_exe EXCEL.EXE
				Send, `n ;Sends line breat after last entry to avoid overwriting the last inserted hyperlink with a space
			Else 
				Send, %A_Space% ;Sends space after last entry in all apps but Excel (sending space there would overwrite the cell content)
		}
	}
	Return

InsertShortcut: ;Inserts shortcuts to previously selected folders and files via Ctr+Alt+k
	TargetLocation := Explorer_GetSelection()
	MsgBox %TargetLocation% ;Debug
	For index, value in HLArray ;Loops through all values in the HLArray
	{
		ShortcutText := SubStr(value, InStr(value, "\", false, -1, 1)+1) ;Visible text of the hyperlink = substring to the right of "/" inside value of current array item 
		LinkFile := TargetLocation . "\" . ShortcutText
		IfWinActive, ahk_exe Explorer.exe
			FileCreateShortcut, %value%, %LinkFile%.lnk
	}
	Return

Explorer_GetSelection() 
{
   WinGetClass, winClass, % "ahk_id" . hWnd := WinExist("A")
   if !(winClass ~= "^(Progman|WorkerW|(Cabinet|Explore)WClass)$")
      Return
   
   shellWindows := ComObjCreate("Shell.Application").Windows
   if (winClass ~= "Progman|WorkerW")  ; IShellWindows::Item:    https://goo.gl/ihW9Gm
                                       ; IShellFolderViewDual:   https://goo.gl/gnntq3
      shellFolderView := shellWindows.Item( ComObject(VT_UI4 := 0x13, SWC_DESKTOP := 0x8) ).Document
   else 
   {
      for window in shellWindows       ; ShellFolderView object: https://is.gd/eyZ4zG
         if (hWnd = window.HWND) && (shellFolderView := window.Document)
            break
   }
		for item in shellFolderView.SelectedItems
			result .= (result = "" ? "" : "`n") . item.Path
		if !result
			result := shellFolderView.Folder.Self.Path
		Return result
}

SetClipboardHTML(HtmlBody, HtmlHead:="", AltText:="") {       ; v0.67 by SKAN on D393/D42B
Local  F, Html, pMem, Bytes, hMemHTM:=0, hMemTXT:=0, Res1:=1, Res2:=1   ; @ tiny.cc/t80706
Static CF_UNICODETEXT:=13,   CFID:=DllCall("RegisterClipboardFormat", "Str","HTML Format")

  If ! DllCall("OpenClipboard", "Ptr",A_ScriptHwnd)
    Return 0
  Else DllCall("EmptyClipboard")

  If (HtmlBody!="")
  {
      Html     := "Version:0.9`r`nStartHTML:00000000`r`nEndHTML:00000000`r`nStartFragment"
               . ":00000000`r`nEndFragment:00000000`r`n<!DOCTYPE>`r`n<html>`r`n<head>`r`n"
                         . HtmlHead . "`r`n</head>`r`n<body>`r`n<!--StartFragment -->`r`n"
                              . HtmlBody . "`r`n<!--EndFragment -->`r`n</body>`r`n</html>"

      Bytes    := StrPut(Html, "utf-8")
      hMemHTM  := DllCall("GlobalAlloc", "Int",0x42, "Ptr",Bytes+4, "Ptr")
      pMem     := DllCall("GlobalLock", "Ptr",hMemHTM, "Ptr")
      StrPut(Html, pMem, Bytes, "utf-8")

      F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","<html>", "Ptr") - pMem
      StrPut(Format("{:08}", F), pMem+23, 8, "utf-8")
      F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","</html>", "Ptr") - pMem
      StrPut(Format("{:08}", F), pMem+41, 8, "utf-8")
      F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","<!--StartFra", "Ptr") - pMem
      StrPut(Format("{:08}", F), pMem+65, 8, "utf-8")
      F := DllCall("Shlwapi.dll\StrStrA", "Ptr",pMem, "AStr","<!--EndFragm", "Ptr") - pMem
      StrPut(Format("{:08}", F), pMem+87, 8, "utf-8")

      DllCall("GlobalUnlock", "Ptr",hMemHTM)
      Res1  := DllCall("SetClipboardData", "Int",CFID, "Ptr",hMemHTM)
  }

  If (AltText!="")
  {
      Bytes    := StrPut(AltText, "utf-16")
      hMemTXT  := DllCall("GlobalAlloc", "Int",0x42, "Ptr",(Bytes*2)+8, "Ptr")
      pMem     := DllCall("GlobalLock", "Ptr",hMemTXT, "Ptr")
      StrPut(AltText, pMem, Bytes, "utf-16")
      DllCall("GlobalUnlock", "Ptr",hMemTXT)
      Res2  := DllCall("SetClipboardData", "Int",CF_UNICODETEXT, "Ptr",hMemTXT)
  }

  DllCall("CloseClipboard")
  hMemHTM := hMemHTM ? DllCall("GlobalFree", "Ptr",hMemHTM) : 0

Return (Res1 & Res2)
}

teadrinker
Posts: 4309
Joined: 29 Mar 2015, 09:41
Contact:

Re: Convert File / Folder Paths into Hyperlinks / Shortcuts

Post by teadrinker » 30 May 2022, 14:33

Trisolaris wrote: When I'm on the desktop and fire the Explorer_GetSelection() function, it returns the desktop path as TargetLocation.
I'm not sure that I undestand what the issue is. For me the function works as expected. When on desktop some object is selected, it returns the path to selected object/objects. If there is no selection it returns the path to the desktop. The same for any explorer folder.

User avatar
Xtra
Posts: 2744
Joined: 02 Oct 2015, 12:15

Re: Convert File / Folder Paths into Hyperlinks / Shortcuts

Post by Xtra » 30 May 2022, 21:28

Maybe this will give you some ideas how to ditch the libs:

Code: Select all

#NoEnv
#Persistent
OnClipboardChange("ClipChange")

ClipChange(type) {
	if (type = 1) {    ; = text
		HLStr := Clipboard
        Loop, Parse, HLStr, `n, `r
        {
            RegExMatch(A_LoopField, "(.*\\)(.+)", m)
            output .= "<a href=""" . StrReplace(m1 . m2, " ", "%20") . """>" . m2 . "</a>`n"
        }
		OnClipboardChange("ClipChange", 0)
		Clipboard := ""
		Clipboard := RTrim(output, "`n")
		ClipWait, 2
		OnClipboardChange("ClipChange", 1)
	}
}

Esc::ExitApp
Usage: Copy and paste anywhere.

Post Reply

Return to “Scripts and Functions (v1)”