Neo Editable Macros

General questions about using TextPad

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

Post Reply
Roy Beatty

Neo Editable Macros

Post by Roy Beatty »

I was thinking about editable macros again / TextPad scripting again. It seems to me that it should be possible to implement it with two specific and simple (I hope) enhancements.

I. TOOLS TO EXECUTE MACROS<br>
----------------------------<br>
Allow a tool program to execute a TextPad macro. And by "macro" I do not mean "tool parameter" macros. I do not mean "page header/footer" macros. I mean allowing a tool program to invoke keystroke macros. Moreover, I suggest that tool programs execute macros *by filename* rather than by their ordinal position on the Macro menu. When this is implemented, someone, probably Jeff Epstein, will submit to "TextPad Add-ons" a set of elementary keystroke macros with standardized names, thus creating for tool programs a virtual "sendkeys" capability.

Benefit: With Sendkeys, can we achieve everything we hope to achieve with edittable macros?

II. TOOL STAYS RUNNING DURING MACRO<br>
------------------------------------<br>
Allow a tool program to invoke a keystroke macro WHILE IT IS STILL RUNNING, allowing it to invoke any number of macros during its execution. If those invoked macros cause execution of the same program (which could still be running), I ask that TextPad permit the recursions, presuming the user is using a tool/language that can keep things straight. Obviously I am envisioning a tool whose "Command Results" consist of changes it makes in the active window. Therefore it would be nice, though not strictly necessary, to allow a tool definition to suppress involvement with TextPad's built-in Command Results window.

Benefit: Potentially, all user-defined shortcuts could all execute one program that would operate differently based on the keystrokes used in calling the it.

III. TOOL PARAMETER MACRO IMPROVEMENTS<br>
--------------------------------------<br>
(a) New: $LastKey: Holds the last keystroke character hit prior to tool running.<br>
(b) New: $LastShortcut: Holds the keystroke characters comprising the last invoked shortcut.<br>
(c) New: $MacroPaths: Current search paths (";" separated) TextPad is using to finding macros.<br>
(d) Change: $Sel: If selection spans lines, have $Sel refer to all lines, not just the first.<br>

Extra credit: allow a tool program to replace the selected text with a string built by the tool program. (Again, it would be nice if the change takes effect in the TextPad window while the program continues execution.)

Other information would also be useful, difficulty permitting:<br>
(e) number of bookmarks before the cursor<br>
(f) number of bookmarks after the cursor<br>
(g) window size<br>

------------------------------------------------

I'd appreciate any feedback as to whether (I) and (II) would satisfy our needs.

Thanks,

Roy
rrbeatty@hot[^spam]mail.com
Roy Beatty

Re: Neo Editable Macros

Post by Roy Beatty »

Oh well, I hereby lower this unsaluted flag.

Onward,

Roy
Lawrence Hare

Re: Neo Editable Macros

Post by Lawrence Hare »

Um, I may be out of line here but I just found a wee error in 4.4.1 and reported it, then saw this topic. Possibly this has been an ongoing topic and I confess to not knowing what is meant by Neo! But I must throw my hat into the ring to say I would just LOVE to have editable macros! An old Macintosh editor named QUED/M - which I just love - has a fine editing capability and it is extremely powerful. Some of Unix's editors also, like awk, or the stream editor, sed, are wonderful but alas, here I sit on 98SE.

What one tends to end up with is a library of macros for common tasks, some very complex. One may refine and rework macros, copy them and enhance them. By employing a command invoked TextPad which takes and input file, and output file and a macro file as paramters, voila, a filter! This can be placed in a batch file and can be a very powerful tool to have. I can do this with Perl, and perhaps there are other tools that allow it, but how easy to do if TextPad had this ability. You can write a batch file that will take a whole mess of files and perform some global change, like correcting file name case when moving them from Windows to Unix...

It needs a method of transcribing commands into an intermediate language, either while the macro is being generated or when saving it, these go to a file of the same name but with a different extension. Then a tool to convert the intermediate language file to the executable format currently used. This tool can be stand-alone. The intermediate language can be quite criptic, but it does have to be editable. This would solve the problem.

I do not know how TextPad implements this currently. If it uses commands it would be very easy to use, if it uses menu positions and relative window locations it would be harder. For general functions like search and replace it would be effective though in either case.

Then the command line support, which perhaps already exists.

Anyway - my 2 cents worth. I use TextPad for all my editing and this would be a wonderful enhancement.

Lawrence
Jeff Epstein

Re: Neo Editable Macros

Post by Jeff Epstein »

Here's an older thread you might be interested in, that discusses editable macros:

http://www.textpad.com/forum/read.php?f=1&i=707&t=707



:' )

Jeff
http://www.jeffyjeffy.com/textpad
PTo

Re: Neo Editable Macros

Post by PTo »

Textpad programmer's must see the freeware CREdit for a example of WSH (Windows Scripting Hosts) integration. See http://www.geocities.com/plamen_p/credit
The current functionalities of the macros are a shame for one of the best
editors of the market.
This functionnality must be completely rewrite !
Post Reply