Add open/close HTML tag to selection

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
YuanhaoYoung
Posts: 3
Joined: Thu Nov 22, 2012 5:47 am

Add open/close HTML tag to selection

Post 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?
User avatar
woho
Posts: 100
Joined: Tue Sep 02, 2003 9:12 am
Location: Steyr/Austria
Contact:

Post 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
YuanhaoYoung
Posts: 3
Joined: Thu Nov 22, 2012 5:47 am

Post 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.
ak47wong
Posts: 703
Joined: Tue Aug 12, 2003 9:37 am
Location: Sydney, Australia

Post 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.
Post Reply