DevinC wrote: ↑13 Apr 2021, 14:40
How do I embed the URL within the
hotstrings script? I'd like the text output to have a clickable text and does not necessarily to display the full URL.
This can be done by putting HTML on the clipboard. You can put HTML on the clipboard by using WinClip.
Then the clipboard handles all the magic of knowing how to format data depending on the location it is pasted.
Here is some example code:
Code: Select all
; https://autohotkey.com/board/topic/74670-class-winclip-direct-clipboard-manipulations/
#Include <WinClipAPI>
#Include <WinClip>
#f12::
WinClip.Clear()
WinClip.SetText("www.ahkscript.org")
WinClip.SetHTML("<a href=""http://www.ahkscript.org"">Linky to AHK</a>")
WinClip.Paste()
return
#f11::
WinClip.Clear()
WinClip.SetBitmap(A_Desktop "\Temp\1024x1024.jpg")
WinClip.Paste()
return
#f10::
Picture := A_Desktop "\Temp\1024x1024.jpg"
html=
(
<font size="2" face="Calibri" color="black">
<p>Best Regards,<br>Have a nice day!<br>More Greetings and e-mails and that sort of stuff<br><br>
<b><font size="2">
Your Name</b><br>
<a href="mailto:[email protected]">[email protected]</a><br>
<img src=%Picture% alt="My picture";">
)
WinClip.SetHTML(html)
WinClip.Paste()
return
::OS::
WinClip.Clear()
WinClip.SetText("Best Regards,`nHave a nice day!`nMore Greetings and e-mails and that sort of stuff`n`n")
WinClip.Paste()
WinClip.Clear()
WinClip.SetBitmap(A_Desktop "\Temp\1024x1024.jpg")
WinClip.Paste()
return
FG