How to wrap html tags around selected text?

Discussion, questions and support.
Post Reply
abscaps
Posts: 8
Joined: Sep 8th, ’20, 23:16

Post by abscaps » Sep 9th, ’20, 00:02

Hi,

I currently use Sublime Text 3 as my text editor and the app has a great keyboard shortcut that can wrap any selected text with default <p></p> tags. Immediately typing any other tag like h1 will auto fill the beginning and closing tags. This is more useful in a lot of cases than using the html phrase file.

I haven't been able to see how to do this in Fastkeys. Can you point me in the right direction? Thank you.
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Sep 10th, ’20, 17:53

This example will wrap the selected text with the tag. Create a shortcut, Type: Command.

Code: Select all

Clipboard:=""
Send, ^c
ClipWait
InputBox, MyTag,, Tag:,, 150, 120,,,,, p
if ErrorLevel or not MyTag
    return
SendInput, <%MyTag%>%Clipboard%</%MyTag%>
return
abscaps
Posts: 8
Joined: Sep 8th, ’20, 23:16

Post by abscaps » Sep 10th, ’20, 21:00

Wow! Thanks very much! I never would have figured that out. Cheers. :)
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Sep 28th, ’20, 08:30

Even better:
Type: Send

Code: Select all

<%SELECT_Tag%>%Clipboard%</%SELECT_Tag%>
where SELECT_Tag is a Selection form macro with a list of tag selections.
Post Reply