Page 1 of 1

Add open/close HTML tag to selection

Posted: Thu Nov 22, 2012 6:01 am
by YuanhaoYoung
Hi all,

I apologize if this has been asked or answered before, but a quick search didn't turn up the answer. I'm still using TextPad 4.7.3, and was wondering if there is a way to write a macro that will add a specific open and close tag to the selected text.

Say I have the words "So the butler did it!" selected, is there a way for a macro to add (for example) <i> before the selection and </i> after it?

Posted: Sun Nov 25, 2012 8:00 pm
by woho
no macro required. There are 'clip libraries' for that.
Some of them are already installed (I believe HTML is, but don't have Textpad on the PC I'm writing this from), more you can download from http://www.textpad.com/add-ons/cliplibs.html

There are two types of clips. Such that insert text where the cursor is or replace text selected and such that insert text before and after a selection.

See also Textpad online help.

woho

Posted: Wed Nov 28, 2012 3:06 am
by YuanhaoYoung
Wow, I'm amazed I've used TextPad this long and wasn't aware of this! This almost does what I want. Now the only thing is, can I trigger a clip using a key instead of the mouse? I tried recording a macro to trigger the clip, but that didn't seem to work, and I can't find a way to associate a keystroke with a particular clip.

Posted: Sat Dec 08, 2012 4:55 pm
by ak47wong
There's no way to assign a shortcut key to a particular Clip Library entry, but you can press Alt+2 to activate the Clip Library, select the desired entry with the arrow keys, and then press Enter to insert it.