Page 1 of 1

Macro playback enhancement

Posted: Tue Jun 13, 2023 4:14 pm
by cole
Hello,
I use the macro facility a lot in TextPad often to process and tweak large files.

For instance I might copy and select text within a line; move it around a bit and then move down to the next line.
I then often playback the macro "To end of file" to process all lines.

I've learnt over the years to just leave the macro running and to not touch anything else on Windows i.e. changing focus to another app, clicking within TextPad etc. Mostly the macro playback works great.

Occasionally though you'll get the BEL sound. When you do there will be a bit of corruption in the playback for the current line; but the follow-on macros often continue correctly.
I've often thought that this could be down to missed steps due to repeated macros playbacks occuring too close to each other?
On a large macro processed file it can be tricky to search back and find BEL corrupted lines. If a BEL happens, I try doing the same against the whole file using repeated CTRL+R single macro playbacks instead. If the BEL happens then I'm at least close to the error'd line so can stop quickly, fix the line and continue.

As an enhancement what I'd like is a checkbox added to the Macros->multi-play... dialog that terminates playback if a macro BEL/error occurs.
That way I could correct the line and then continue multi play from that point on.

It would also be great if during a macro playback all external TextPad input is ignored; such as mouse clicks and key presses. It doesn't seem to do this.

Kind Regards

Re: Macro playback enhancement

Posted: Wed Jun 14, 2023 7:40 am
by AmigoJack
cole wrote: Tue Jun 13, 2023 4:14 pmif during a macro playback all external TextPad input is ignored
It's difficult to judge if input comes from the program's own windows or from elsewhere. As a result one wouldn't be able to pause/stop a macro anymore, should input be disabled.
cole wrote: Tue Jun 13, 2023 4:14 pmto not touch anything else on Windows i.e. changing focus to another app
If you do that via Alt+Tab (or Win+D) then downholding the Alt key is still reported to the focused window/program, which could then interfere with whatever the macro actions may interpret when that key is held - try changing input focus via mouse only, i.e. clicking the minimize button of TextPad's window, or just clicking the taskbar button of a different window/program.

Furthermore: if your macro actions consist of keystrokes then consider replacing them with actual commands (f.e. instead of Ctrl+X use TextPad's "cut" from the menu, namely EditCut). The more you record via choosing from menus, the less likely a running macro will interfere with input happening then (I suppose).