March 9, 2020

Text Expander supporting links / rich text format

Text Expander functionality is really useful. I have used PhraseExpress on Windows for this a lot (free for personal use only).
Now you can also use AutoHotkey for this using the so-called Hotstrings.
I present here a way to use Hotstrings that support links i.e. rich-text formatting.
It is based on the AutoHotkey utility I have highlighted in a previous post: WinClip

Script Synopsis

  • Simply build the HTML string representing the content you want to insert.
For a simple link it looks like this:
sText = Link text
sLink :=  "https://..."
sHtml = <a href="%sLink%">%sText%</a>
WinClip.SetHTML(sHtml)
WinClip.Paste() 

You can have a look at my TextExpander script here.

Example: Teams-me Hotstring for signature link

This is how to create a Teams-me link shortcut:

::teamsme:: ; Teams Me Chat Link (rtf)
sText = Chat with me in Teams
sLink :=  "https://teams.microsoft.com/l/chat/0/0?users=Thierry.Dalon@xxx.com"
; remove % e.g. replace %20 by blank
sHtml = <a href="%sLink%">%sText%</a>
WinClip.SetHTML(sHtml)
WinClip.SetText(sLink)
WinClip.Paste() 
return


No comments:

Post a Comment