edit a macro or create a new one

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
User avatar
webber123456
Posts: 50
Joined: Wed Jul 30, 2003 2:55 am

edit a macro or create a new one

Post by webber123456 »

I found a macro which underlines text.

Currently, the macro underlines properly by indenting as needed and placing underscore character for length of text.

I would like to know how to edit the macro, or know how to build a new one, which adds an apostrophe as the first character of the underline so it appears as:

'my text here
'---------------

any help available ??
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Cannot edit macros in TextPad now. But cast a vote here:
http://www.textpad.com/forum/viewtopic.php?t=3775

Also consider using Macro Scheduler as a Macro tool for all applications.
Hope this was helpful.............good luck,
Bob
User avatar
webber123456
Posts: 50
Joined: Wed Jul 30, 2003 2:55 am

Interesting program but...

Post by webber123456 »

Interesting program but I don't see an easy way to integrate it with Textpad.

Can anyone give me a few clues on how to build a macro to achieve the underline effect as described above ??


thanks.
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

I may have some ideas, but need to understand "underline". When you say "underline" are you inserting characters on the next line, beneath the characers above? Does this mean text is already double spaced?
Hope this was helpful.............good luck,
Bob
User avatar
webber123456
Posts: 50
Joined: Wed Jul 30, 2003 2:55 am

underline macro

Post by webber123456 »

yes, the underline is directly below the existing selected line of text and indented to match position and also matches length.

My guess at how to do this for the line of text selected is:

1-copy the selected line,
2-paste it below the existing,
3-replace all characters with underscore character,
4 select new line and then
5-replace first underscore character of new line with apostrophe

now the trick is to get this into a macro via some type of regular expression thingy :)
User avatar
webber123456
Posts: 50
Joined: Wed Jul 30, 2003 2:55 am

no luck with regular expression

Post by webber123456 »

can anyone offer some suggestions on what the regular expression might be ?
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

You can select the new line using something like ([^ ]+.*[^ ])+ (POSIX style) but after that I'm stumped. The Edit->Fill block command is grayed out after a regex selection, is that normal? (I have block mode on and word wrap off)
Then I open up and see
the person fumbling here is me
a different way to be
Post Reply